SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.stats.test.timeseries.adf
Class AugmentedDickeyFuller

java.lang.Object
  extended by com.numericalmethod.suanshu.stats.test.HypothesisTest
      extended by com.numericalmethod.suanshu.stats.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 is adf.test in package tseries.

See Also:

Nested Class Summary
static class AugmentedDickeyFuller.TrendType
          the three versions of augmented Dickey-Fuller (ADF) test
 
Field Summary
 int lagOrder
          the lag order
 AugmentedDickeyFuller.TrendType type
          the trend type
 
Fields inherited from class com.numericalmethod.suanshu.stats.test.HypothesisTest
k, N, pValue, testStatistics
 
Constructor Summary
AugmentedDickeyFuller(double[] xt)
          Perform the Augmented Dickey-Fuller test statistics to test for the existence of uniroot.
AugmentedDickeyFuller(double[] xt, AugmentedDickeyFuller.TrendType type, int lagOrder, AdfDistribution dist)
          Perform the Augmented Dickey-Fuller test statistics to test for the existence of uniroot.
 
Method Summary
 java.lang.String alternativeHypothesis()
          Get a description of the alternative hypothesis.
 java.lang.String nullHypothesis()
          Get a description of the null hypothesis.
 
Methods inherited from class com.numericalmethod.suanshu.stats.test.HypothesisTest
oneSidedPvalue, pValue, rejectNull, testStatistics
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

public final AugmentedDickeyFuller.TrendType type
the trend type


lagOrder

public final int lagOrder
the lag order

Constructor Detail

AugmentedDickeyFuller

public AugmentedDickeyFuller(double[] xt,
                             AugmentedDickeyFuller.TrendType type,
                             int lagOrder,
                             AdfDistribution dist)
Perform the Augmented Dickey-Fuller test statistics to test for the existence of uniroot.

Parameters:
xt - a time series
type - the trend type
lagOrder - the lags; when lagOrder == 0, we perform the standard Dickey-Fuller test.
dist - the ADF distribution to use; in general, the correct ADF distribution to use depends on the trend type, as well as lag order; to improve accuracy, the user may generate and use a customized ADF distribution; null if to use the default

AugmentedDickeyFuller

public AugmentedDickeyFuller(double[] xt)
Perform the Augmented Dickey-Fuller test statistics to test for the existence of uniroot.

Lag order is automatically selected as in R.

nLag = (int) Math.pow((series.length - 1, 1.0 / 3.0));
which corresponds to the suggested upper bound on the rate.

Parameters:
xt - a time series
Method Detail

nullHypothesis

public java.lang.String nullHypothesis()
Description copied from class: HypothesisTest
Get a description of the null hypothesis.

Specified by:
nullHypothesis in class HypothesisTest
Returns:
the null hypothesis description
See Also:
Wikipedia: Null hypothesis

alternativeHypothesis

public java.lang.String alternativeHypothesis()
Description copied from class: HypothesisTest
Get a description of the alternative hypothesis.

Specified by:
alternativeHypothesis in class HypothesisTest
Returns:
the alternative hypothesis description
See Also:
Wikipedia: Alternative hypothesis

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.