Class CorrelationComputer
java.lang.Object
com.strategyquant.tradinglib.correlation.CorrelationComputer
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intThe Constant ERROR_VALUE.static org.slf4j.LoggerThe Constant Log.String[]The periods.The range.double[]The values1.double[]The values2. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doublecalculateCorrelation(double[] valuesA, double[] valuesB)Calculate correlation between two value arrays.static doublecalculateSimilarity(double[] trades, double[] line)doublecomputeCorrelation(boolean addEmptyPeriods, String symbol1, String symbol2, OrdersList orderList1, OrdersList orderList2, CorrelationPeriods periods)Compute correlation between two list of orders.doublecomputeCorrelation(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)
-