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
from the tseries package.
bdstest_ews(timeseries, ARMAoptim = TRUE, ARMAorder = c(1, 0), GARCHorder = c(0, 1), embdim = 3, epsilon = c(0.5, 0.75, 1), boots = 1000, logtransform = FALSE, interpolate = FALSE)
ARMA(p,q)
model to be fitted on the original timeseries. If TRUE
the best ARMA model based on AIC is applied. If FALSE the
ARMAorder
is used.AR(p)
and
MA(q)
process to be fitted on the original
timeseries. Default is p=1
q=0
.GARCHorder[1]
is the GARCH part
and GARCHorder[2]
is the ARCH part.embdim
) up to which the BDS test will be estimated
(must be numeric). Default value is 3.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.
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.Arguments:
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
#
data(foldbif)
bdstest_ews(foldbif,ARMAoptim=FALSE,ARMAorder=c(1,0),embdim=3,epsilon=0.5,
boots=200,logtransform=FALSE,interpolate=FALSE)
Run the code above in your browser using DataLab