Class GrangerTest
- java.lang.Object
-
- org.processmining.rootcauseanalysis.algorithms.causality.GrangerTest
-
public class GrangerTest extends java.lang.ObjectImplementation of Granger causality test in pure Java. It is based on linear regression implementation in Apache Commons Math.- Author:
- Sergey Edunov Date: 06.01.11, B.F.A. Hompes
(modified code to work with Apache commons-math v3+ (tested with v3.6.1) rather than v2.2)
-
-
Constructor Summary
Constructors Constructor Description GrangerTest()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static GrangerTestResultgranger(double[] y, double[] x, int L)Returns p-value for Granger causality test.static doublesqrSum(double[] a)static double[]strip(int l, double[] a)
-
-
-
Method Detail
-
granger
public static GrangerTestResult granger(double[] y, double[] x, int L)
Returns p-value for Granger causality test.- Parameters:
y- - predictable variablex- - predictorL- - lag, should be 1 or greater.- Returns:
- p-value of Granger causality
-
sqrSum
public static double sqrSum(double[] a)
-
strip
public static double[] strip(int l, double[] a)
-
-