is.nonstat {nonstat} | R Documentation |
Test for nonstationarity
Description
Applies a nonvisual, diagnostic-based screening procedure to determine whether a univariate time series violates the assumption of stationarity. Specifically, the function evaluates (a) the presence of a trend and (b) changes in variance over time. These two dimensions of nonstationarity are assessed using two R-hat-type statistics adapted from Bayesian convergence diagnostics and Levene's test.
Usage
is.nonstat(tseries, nEp = 2, cut.psr1 = 1.1, cut.psr2 = 1.01, span = 3)
Arguments
tseries |
a numerical vector |
nEp |
number of epochs (in which time series is cut for PSR calculation) |
cut.psr1 |
threshold for the trend diagnostic, Rhat(1), which assesses whether a process is trending |
cut.psr2 |
threshold for the changing variance diagnostic, Rhat(2), which assesses whether the processe's variance is changing over time |
span |
numerical value that is passed to the |
Value
a logical scalar indicating whether the prcoess has been diagnosed as non-stationary (TRUE
) or stationary (FALSE
)
References
Zitzmann, S., Lindner, C., Lohmann, J. F., & Hecht, M. (2024). "A Novel Nonvisual Procedure for Screening for Nonstationarity in Time Series as Obtained from Intensive Longitudinal Designs" Preprint
Examples
set.seed( 8332278 )
x <- rnorm( 50 )
is.nonstat( x )