Class CorrelationCalculator
Class that performns correlations between vectors
Inherited Members
Namespace: TimeSeriesAnalysis
Assembly: TimeSeriesAnalysis.dll
Syntax
public class CorrelationCalculator
Methods
| Edit this page View SourceCalculate(double[], double[], List<int>)
Calculate the correlation factor between signal1 and signal 2.
Declaration
public static double Calculate(double[] signal1, double[] signal2, List<int> indicesToIgnore = null)
Parameters
Type | Name | Description |
---|---|---|
double[] | signal1 | |
double[] | signal2 | |
List<int> | indicesToIgnore | Optionally ignore indices in this list from signal1 and signal2 |
Returns
Type | Description |
---|---|
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)
Declaration
public static Dictionary<string, double> Calculate(string signalName, TimeSeriesDataSet dataSet, List<int> indicesToIgnore = null)
Parameters
Type | Name | Description |
---|---|---|
string | signalName | |
TimeSeriesDataSet | dataSet | |
List<int> | indicesToIgnore | these indices are ignored in the calculation (pre-filtered bad or out of range values) |
Returns
Type | Description |
---|---|
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
Declaration
public static List<CorrelationObject> CalculateAndOrder(string mainSignalName, TimeSeriesDataSet dataSet, double minimumCorrCoeffToDoTimeshiftCalc = 0.4, double minimumRsqAbs = 10)
Parameters
Type | Name | Description |
---|---|---|
string | mainSignalName | |
TimeSeriesDataSet | dataSet | the dataset, which must have a correctly set timestamps in order to estimate time constants |
double | minimumCorrCoeffToDoTimeshiftCalc | calculate time-shift for every corr coeff that is above this threshold(0.0-1.0) |
double | minimumRsqAbs | for a time-shift to be valid, the resulting model nees to have Rsq over this threshold |
Returns
Type | Description |
---|---|
List<CorrelationObject> | a |
CorrelateTwoVectors(double[], double[], List<int>)
Determine the correlation betweeen vectors v1 and v2
Declaration
public static double CorrelateTwoVectors(double[] v1, double[] v2, List<int> indicesToIgnore)
Parameters
Type | Name | Description |
---|---|---|
double[] | v1 | |
double[] | v2 | |
List<int> | indicesToIgnore |
Returns
Type | Description |
---|---|
double |