Class CorrelationCalculator
- Namespace
- TimeSeriesAnalysis
- Assembly
- TimeSeriesAnalysis.dll
Class that performs correlations between vectors
public class CorrelationCalculator
- Inheritance
-
CorrelationCalculator
- Inherited Members
Methods
Calculate(double[], double[], List<int>)
Calculate the correlation factor between signal1 and signal 2.
public static double Calculate(double[] signal1, double[] signal2, List<int> indicesToIgnore = null)
Parameters
signal1double[]signal2double[]indicesToIgnoreList<int>Optionally ignore indices in this list from signal1 and signal2
Returns
Calculate(string, TimeSeriesDataSet, List<int>)
Calculates correlation factors [-1,1] for a signal against all other signals in the dataset (this corresponds to one row or one column of the covariance matrix)
public static Dictionary<string, double> Calculate(string signalName, TimeSeriesDataSet dataSet, List<int> indicesToIgnore = null)
Parameters
signalNamestringdataSetTimeSeriesDataSetindicesToIgnoreList<int>these indices are ignored in the calculation (pre-filtered bad or out of range values)
Returns
CalculateAndOrder(string, TimeSeriesDataSet, double, double)
Calculates correlation factors [-1,1] for a signal against all other signals in the dataset returning the results in a list from highest to lowest score absolute correlation factor
public static List<CorrelationObject> CalculateAndOrder(string mainSignalName, TimeSeriesDataSet dataSet, double minimumCorrCoeffToDoTimeshiftCalc = 0.4, double minimumFitScore = 10)
Parameters
mainSignalNamestringdataSetTimeSeriesDataSetthe dataset, which must have a correctly set timestamps in order to estimate time constants(also consider indicesToIgnore!)
minimumCorrCoeffToDoTimeshiftCalcdoublecalculate time-shift for every corr coefficient with absolute value that is above this threshold(0.0-1.0)
minimumFitScoredoublefor a time-shift to be valid, the resulting model needs to have Rsq over this threshold
Returns
CorrelateTwoVectors(double[], double[], List<int>)
Determine the correlation between vectors v1 and v2
public static double CorrelateTwoVectors(double[] v1, double[] v2, List<int> indicesToIgnore)