Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/ddjnonparam_ews.R
ddjnonparam_ews
is used to compute
nonparametrically conditional variance, drift, diffusion
and jump intensity in a timeseries. It also interpolates
to obtain the evolution of the nonparametric statistics
in time.
1 2 | ddjnonparam_ews(timeseries, bandwidth = 0.6, na = 500,
logtransform = TRUE, interpolate = FALSE)
|
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. |
bandwidth |
is the bandwidht of the kernel regressor (must be numeric). Default is 0.6. |
na |
is the number of points for computing the kernel (must be numeric). Default is 500. |
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). |
The approach is based on estimating terms of a drift-diffusion-jump model as a surrogate for the unknown true data generating process: [1] dx = f(x,θ)dt + g(x,θ)dW + dJ Here x is the state variable, f() and g() are nonlinear functions, dW is a Wiener process and dJ is a jump process. Jumps are large, one-step, positive or negative shocks that are uncorrelated in time.
ddjnonparam_ews
returns an object with elements:
avec |
is the mesh for which values of the nonparametric statistics are estimated. |
S2.vec |
is the conditional variance of the
timeseries |
TotVar.dx.vec |
is the total variance of |
Diff2.vec |
is the diffusion estimated as
|
LamdaZ.vec |
is the jump intensity over
|
Tvec1 |
is the timeindex. |
S2.t |
is the conditional variance of the timeseries
|
TotVar.t |
is the total variance of |
Diff2.t |
is the diffusion over |
Lamda.t |
is the jump intensity over |
In addition, ddjnonparam_ews
returns a first plot
with the original timeseries and the residuals after
first-differencing. A second plot shows the nonparametric
conditional variance, total variance, diffusion and jump
intensity over the data, and a third plot the same
nonparametric statistics over time.
S. R. Carpenter, modified by V. Dakos
Carpenter, S. R. and W. A. Brock (2011). "Early warnings of unknown nonlinear shifts: a nonparametric approach." Ecology 92(12): 2196-2201
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
1 2 3 |
Loading required package: ggplot2
Loading required package: moments
Loading required package: tgp
Loading required package: tseries
earlywarnings Copyright (C) 2011-2013 Vasilis Dakos and Leo Lahti
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it under the FreeBSD open source license. For more information, see http://www.early-warning-signals.org
dev.new(): using pdf(file="Rplots1.pdf")
dev.new(): using pdf(file="Rplots2.pdf")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.