Class CorrelationComputer
java.lang.Object
com.strategyquant.tradinglib.correlation.CorrelationComputer
-
Field Summary
Modifier and TypeFieldDescriptionstatic int
The Constant ERROR_VALUE.static org.slf4j.Logger
The Constant Log.String[]
The periods.The range.double[]
The values1.double[]
The values2. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic double
calculateCorrelation(double[] valuesA, double[] valuesB)
Calculate correlation between two value arrays.static double
calculateSimilarity(double[] trades, double[] line)
double
computeCorrelation(boolean addEmptyPeriods, String symbol1, String symbol2, OrdersList orderList1, OrdersList orderList2, CorrelationPeriods periods)
Compute correlation between two list of orders.double
computeCorrelation(ResultsGroup rg1, ResultsGroup rg2, int period, CorrelationType type, boolean addEmptyPeriods)
-
Field Details
-
Log
public static final org.slf4j.Logger LogThe Constant Log. -
ERROR_VALUE
public static final int ERROR_VALUEThe Constant ERROR_VALUE.- See Also:
- Constant Field Values
-
range
The range. -
periodsStr
The periods. -
values1
public double[] values1The values1. -
values2
public double[] values2The values2.
-
-
Constructor Details
-
CorrelationComputer
public CorrelationComputer()
-
-
Method Details
-
computeCorrelation
public double computeCorrelation(ResultsGroup rg1, ResultsGroup rg2, int period, CorrelationType type, boolean addEmptyPeriods) -
computeCorrelation
public double computeCorrelation(boolean addEmptyPeriods, String symbol1, String symbol2, OrdersList orderList1, OrdersList orderList2, CorrelationPeriods periods)Compute correlation between two list of orders.- Parameters:
addEmptyPeriods
- the add empty periodsorderList1
- the order list1orderList2
- the order list2- Returns:
- the double
-
calculateCorrelation
public static double calculateCorrelation(double[] valuesA, double[] valuesB)Calculate correlation between two value arrays.- Parameters:
valuesA
- array of values avaluesB
- array of values b- Returns:
- the double
-
calculateSimilarity
public static double calculateSimilarity(double[] trades, double[] line)
-