Description Usage Arguments Details Value Author(s) References See Also
bdstest_ews
is used to estimate the BDS statistic
to detect nonlinearity in the residuals of a timeseries
after first-difference detrending, fitting an ARMA(p,q)
model, and fitting a GARCH(0,1) model. The function is
making use of bds.test
.
1 2 3 4 |
timeseries |
a numeric vector of the observed univariate timeseries values or a numeric matrix where the first column represents the time index and the second the observed timeseries values. Use vectors/matrices with headings. |
ARMAoptim |
is the order of the |
ARMAorder |
is the order of the |
GARCHorder |
fits a GARCH model on the original
timeseries where |
embdim |
is the embedding dimension (2, 3,...
|
epsilon |
is a numeric vector that is used to scale the standard deviation of the timeseries. The BDS test is computed for each element of epsilon. Default is 0.5, 0.75 and 1. |
boots |
is the number of bootstraps performed to estimate significance p values for the BDS test. Default is 1000. |
logtransform |
logical. If TRUE data are logtransformed prior to analysis as log(X+1). Default is FALSE. |
interpolate |
logical. If TRUE linear interpolation is applied to produce a timeseries of equal length as the original. Default is FALSE (assumes there are no gaps in the timeseries). |
See also bds.test{tseries}
for more details. The
function requires the installation of packages
tseries
and quadprog
that are not available
under Linux and need to be manually installed under
Windows.
Example to run after installing the mentioned packages:
data(foldbif) bdstest_ews(foldbif,ARMAoptim=FALSE,ARMAorder=c(1,0),embdim=3,epsilon=0.5, boots=200,logtransform=FALSE,interpolate=FALSE)
bdstest_ews
returns output on the R console that
summarizes the BDS test statistic for all embedding
dimensions and epsilon
values used, and for
first-differenced data, ARMA(p.q) residuals, and
GARCH(0,1) residuals). Also the significance p values are
returned estimated both by comparing to a standard normal
distribution and by bootstrapping.
In addition, bdstest_ews
returns a plot with the
original timeseries, the residuals after
first-differencing, and fitting the ARMA(p,q) and
GARCH(0,1) models. Also the autocorrelation
acf
and partial autocorrelation
pacf
functions are estimated serving as
guides for the choice of lags of the linear models fitted
to the data.
S. R. Carpenter, modified by V. Dakos
J. B. Cromwell, W. C. Labys and M. Terraza (1994): Univariate Tests for Time Series Models, Sage, Thousand Oaks, CA, pages 32-36.
Dakos, V., et al (2012)."Methods for Detecting Early Warnings of Critical Transitions in Time Series Illustrated Using Simulated Ecological Data." PLoS ONE 7(7): e41010. doi:10.1371/journal.pone.0041010
generic_ews
; ddjnonparam_ews
;
bdstest_ews
; sensitivity_ews
;
surrogates_ews
; ch_ews
;
movpotential_ews
;
livpotential_ews
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.