Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
For questions about programming languages, implementation, and packages in quantitative finance. Note: question must be specific to quantitative finance and must necessitate knowledge of quantitative finance in order to be on topic.
1
vote
1
answer
1k
views
How to calculate the hedge ratio between two securities using the Least Squares model in Java
How does one, having two lists of prices Y and X and wishing to fit the Least Squares model, perform this in Java?
The fit is required to calculate the hedge ratio in a pairs trading strategy.
For e …
1
vote
How to calculate the hedge ratio between two securities using the Least Squares model in Java
The below code works for us:
final boolean includeIntercept = false;
SimpleRegression simpleRegression = new SimpleRegression(includeIntercept);
for (int i = 0; i < symbol1Bars.size(); i …