adf¶
Purpose¶
Computes the Augmented Dickey-Fuller unit root test.
Format¶
-
{ tstat, lags, cv } =
adf(y, model[, pmax, ic])¶ Parameters: - y (Nx1 matrix) – Time series data to be tested.
- model (Scalar) –
Model to be implemented.
0 No constant or trend. 1 Constant. 2 Constant and trend. - pmax (Scalar) – Optional, the maximum number of lags for \(\Delta y\). Default = 8.
- ic (Scalar) –
Optional, the information criterion used for choosing lags. Default = 3.
1 Akaike. 2 Schwarz. 3 t-stat significance.
Returns: - tstat (Scalar) – Dickey-Fuller test statistic.
- lags (Scalar) – Number of lags selected by chosen information criterion.
- cv (Vector) – 1%, 5%, and 10% critical values for ADF \(\tau\)-stat.
Examples¶
library tspdlib;
// Load date file
y = loadd(getGAUSSHome() $+ "pkgs/tspdlib/examples/ts_examples.csv", "Y");
// No deterministic component
model = 0;
// Call ADF test
{ ADFtau, ADFp, cvADF } = ADF(y, model);