Package dev.nm.stat.test.timeseries.adf
Class AugmentedDickeyFuller
- java.lang.Object
-
- dev.nm.stat.test.HypothesisTest
-
- dev.nm.stat.test.timeseries.adf.AugmentedDickeyFuller
-
public class AugmentedDickeyFuller extends HypothesisTest
The Augmented Dickey Fuller test tests whether a one-time differencing (d = 1) will make the time series stationary. That is, whether the series has a unit root. Cheung and Lai (1995) pointed out that the lag order does have some effect on the critical values, esp. when the sample size is small. The R equivalent function isadf.test
in packagetseries
.- See Also:
- "S. E. Said and D. A. Dickey, "Testing for Unit Roots in Autoregressive-Moving Average Models of Unknown Order," Biometrika, vol. 71, no. 3, pp.599-607, 1984."
- "Yin-Wong Cheung, Kon S. Lai, "ESTIMATING FINITE SAMPLE CRITICAL VALUES FOR UNIT ROOT TESTS USING PURE RANDOM WALK PROCESSES," Journal of Time Series Analysis, vol. 16, issue 5, pp.493-498, 1995."
-
-
Constructor Summary
Constructors Constructor Description AugmentedDickeyFuller(double[] x)
Performs the Augmented Dickey-Fuller test to test for the existence of unit root.AugmentedDickeyFuller(double[] x, TrendType type, int lagOrder, ADFDistribution dist)
Performs the Augmented Dickey-Fuller test to test for the existence of unit root.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAlternativeHypothesis()
Get the description of the alternative hypothesis.String
getNullHypothesis()
Get a description of the null hypothesis.double
pValue()
Get the p-value for the test statistics.double
statistics()
Get the test statistics.-
Methods inherited from class dev.nm.stat.test.HypothesisTest
isNullRejected, nGroups, nObs, oneSidedPvalue
-
-
-
-
Constructor Detail
-
AugmentedDickeyFuller
public AugmentedDickeyFuller(double[] x, TrendType type, int lagOrder, ADFDistribution dist)
Performs the Augmented Dickey-Fuller test to test for the existence of unit root.- Parameters:
x
- a time seriestype
- the trend typelagOrder
- the lag order; whenlagOrder
= 0, we perform the original Dickey-Fuller test.dist
- the ADF distribution to use; in general, the correct ADF distribution depends on the trend type and lag order; to improve accuracy, the user may generate and use a customized ADF distribution;null
for the default
-
AugmentedDickeyFuller
public AugmentedDickeyFuller(double[] x)
Performs the Augmented Dickey-Fuller test to test for the existence of unit root. Lag order is automatically selected as in R.
This corresponds to the suggested upper bound on the rate.nLag = (int) Math.pow((series.length - 1, 1.0 / 3.0));
- Parameters:
x
- a time series
-
-
Method Detail
-
getNullHypothesis
public String getNullHypothesis()
Description copied from class:HypothesisTest
Get a description of the null hypothesis.- Specified by:
getNullHypothesis
in classHypothesisTest
- Returns:
- the null hypothesis description
- See Also:
- Wikipedia: Null hypothesis
-
getAlternativeHypothesis
public String getAlternativeHypothesis()
Description copied from class:HypothesisTest
Get the description of the alternative hypothesis.- Specified by:
getAlternativeHypothesis
in classHypothesisTest
- Returns:
- the alternative hypothesis description
- See Also:
- Wikipedia: Alternative hypothesis
-
statistics
public double statistics()
Description copied from class:HypothesisTest
Get the test statistics.- Specified by:
statistics
in classHypothesisTest
- Returns:
- the test statistics
- See Also:
- Wikipedia: Test statistic
-
pValue
public double pValue()
Description copied from class:HypothesisTest
Get the p-value for the test statistics.- Specified by:
pValue
in classHypothesisTest
- Returns:
- the p-value
- See Also:
- Wikipedia: P-value
-
-