Table of Contents

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

signal1 double[]
signal2 double[]
indicesToIgnore List<int>

Optionally ignore indices in this list from signal1 and signal2

Returns

double

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

signalName string
dataSet TimeSeriesDataSet
indicesToIgnore List<int>

these indices are ignored in the calculation (pre-filtered bad or out of range values)

Returns

Dictionary<string, double>

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

mainSignalName string
dataSet TimeSeriesDataSet

the dataset, which must have a correctly set timestamps in order to estimate time constants(also consider indicesToIgnore!)

minimumCorrCoeffToDoTimeshiftCalc double

calculate time-shift for every corr coefficient with absolute value that is above this threshold(0.0-1.0)

minimumFitScore double

for a time-shift to be valid, the resulting model needs to have Rsq over this threshold

Returns

List<CorrelationObject>

a

CorrelateTwoVectors(double[], double[], List<int>)

Determine the correlation between vectors v1 and v2

public static double CorrelateTwoVectors(double[] v1, double[] v2, List<int> indicesToIgnore)

Parameters

v1 double[]
v2 double[]
indicesToIgnore List<int>

Returns

double