Learn R Programming

earlywarnings (version 1.0.38)

movpotential_ews: Description: Moving Average Potential

Description

movpotential_ews reconstructs a potential derived from data along a gradient of a given parameter the movpotential_ews calculates the potential for values that correspond to a particular parameter. see ref below

Usage

movpotential_ews(X, param = NULL, bw = -1,
    detection.threshold = 0.002, std = 1, grid.size = 50,
    plot.cutoff = 0.5)

Arguments

X
a vector of the X observations of the state variable of interest
param
parameter values corresponding to the observations in X
bw
Bandwidth for smoothing kernels. Automatically determined by default.
detection.threshold
Threshold for local minima to be discarded
std
std
grid.size
number of evaluation points; number of steps between min and max potential; also used as kernel window size
plot.cutoff
cuttoff for potential minima and maxima in visualization

Returns:

Value

  • A list with the following elements:
  • parsvalues of the covariate parameter as matrix
  • xisvalues of the x as matrix
  • potssmoothed potentials
  • minsminima in the densities (-potentials; neglecting local optima)
  • maxsmaxima in densities (-potentials; neglecting local optima)
  • plotan object that displays the potential estimated in 2D

References

Hirota, M., Holmgren, M., van Nes, E.H. & Scheffer, M. (2011). Global resilience of tropical forest and savanna to critical transitions. Science, 334, 232-235.

See Also

generic_ews; ddjnonparam_ews; bdstest_ews; sensitivity_ews;surrogates_ews; ch_ews; livpotential_ews

Examples

Run this code
X = c(rnorm(1000, mean = 0), rnorm(1000, mean = -2), rnorm(1000, mean = 2))
 param = seq(0,5,length=3000)
 res <- movpotential_ews(X, param)

Run the code above in your browser using DataLab