Skip to main content
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
Results tagged with
Search options not deleted user 24955

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 …
x86's user avatar
  • 31
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 …
x86's user avatar
  • 31