# kpsstest

KPSS test for stationarity

## Syntax

## Description

uses additional options specified by one or more `h`

= kpsstest(`y`

,`Name,Value`

)`Name,Value`

pair arguments.

If any

`Name,Value`

pair argument is a vector, then all`Name,Value`

pair arguments specified must be vectors of equal length or length one.`kpsstest(y,Name,Value)`

treats each element of a vector input as a separate test, and returns a vector of rejection decisions.If any

`Name,Value`

pair argument is a row vector, then`kpsstest(y,Name,Value)`

returns a row vector.

## Examples

## Input Arguments

## Output Arguments

## More About

## Tips

In order to draw valid inferences from the KPSS test, you should determine a suitable value for

`'lags'`

. These two methods determine a suitable number of lags:Begin with a small number of lags and then evaluate the sensitivity of the results by adding more lags.

Kwiatkowski et al. [2] suggest that a number of lags on the order of $$\sqrt{T}$$, where

*T*is the sample size, is often satisfactory under both the null and the alternative.

For consistency of the Newey-West estimator, the number of lags must approach infinity as the sample size increases.

You should determine the value of

`'trend'`

by the growth characteristics of the time series. Determine its value with a specific testing strategy in mind.If a series is growing, then include a trend term to provide a reasonable comparison of a trend stationary null and a unit root process with drift.

`kpsstest`

sets`'trend',true`

by default.If a series does not exhibit long-term growth characteristics, then don’t include a trend term (i.e., set

`'trend',false`

).

## Algorithms

`kpsstest`

performs a regression to find the ordinary least squares (OLS) fit between the data and the null model.Test statistics follow nonstandard distributions under the null, even asymptotically. Kwiatkowski et al. [2] use Monte Carlo simulations, for models with and without a trend, to tabulate asymptotic critical values for a standard set of significance levels between 0.01 and 0.1.

`kpsstest`

interpolates critical values and p-values from these tables.

## References

[1] Hamilton, J. D. *Time Series Analysis*. Princeton, NJ: Princeton University Press, 1994.

[2] Kwiatkowski, D., P. C. B. Phillips, P. Schmidt, and Y. Shin. “Testing the Null Hypothesis of Stationarity against the Alternative of a Unit Root.”
*Journal of Econometrics*. Vol. 54, 1992, pp. 159–178.

[3] Newey, W. K., and K. D. West. “A Simple, Positive Semidefinite, Heteroskedasticity and Autocorrelation Consistent Covariance Matrix.”
*Econometrica*. Vol. 55, 1987, pp. 703–708.

**Introduced in R2009b**