movpotential_ews {earlywarnings} | R Documentation |
Moving Average Potential
Description
This function reconstructs a potential derived from data along a gradient of a given parameter.
Usage
movpotential_ews(
X,
param = NULL,
bw = "nrd",
bw.adjust = 1,
detection.threshold = 0.1,
std = 1,
grid.size = 50,
plot.cutoff = 0.5,
plot.contours = TRUE,
binwidth = 0.2,
bins = NULL
)
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. |
bw.adjust |
Bandwidth adjustment constant |
detection.threshold |
Threshold for local optima to be discarded. |
std |
Standard deviation. |
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 |
plot.contours |
Plot contours on the landscape visualization |
binwidth |
binwidth for contour plot |
bins |
bins for contour plot. Overrides binwidth if given |
Value
A list with the following elements: pars values of the covariate parameter as matrix; xis values of the x as matrix; pots smoothed potentials; mins minima in the densities (-potentials; neglecting local optima); maxs maxima in densities (-potentials; neglecting local optima); plot an object that displays the potential estimated in 2D
Author(s)
L. Lahti, E. van Nes, V. Dakos.
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.
Examples
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)