Type: | Package |
Title: | Detecting Nonstationarity in Time Series |
Version: | 0.0.6 |
Maintainer: | Martin Hecht <martin.hecht@hsu-hh.de> |
Description: | Provides a nonvisual procedure for screening time series for nonstationarity in the context of intensive longitudinal designs, such as ecological momentary assessments. The method combines two diagnostics: one for detecting trends (based on the split R-hat statistic from Bayesian convergence diagnostics) and one for detecting changes in variance (a novel extension inspired by Levene's test). This approach allows researchers to efficiently and reproducibly detect violations of the stationarity assumption, especially when visual inspection of many individual time series is impractical. The procedure is suitable for use in all areas of research where time series analysis is central. For a detailed description of the method and its validation through simulations and empirical application, see 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" https://www.researchgate.net/publication/384354932_A_Novel_Nonvisual_Procedure_for_Screening_for_Nonstationarity_in_Time_Series_as_Obtained_from_Intensive_Longitudinal_Designs. |
License: | GPL-3 |
Depends: | R (≥ 3.5.0) |
NeedsCompilation: | no |
Encoding: | UTF-8 |
Language: | en-US |
RoxygenNote: | 7.3.2 |
Packaged: | 2025-03-30 20:01:40 UTC; martin |
Author: | Martin Hecht [aut, cre], Steffen Zitzmann [aut] |
Repository: | CRAN |
Date/Publication: | 2025-04-01 15:50:02 UTC |
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 )