Learn R Programming

earlywarnings (version 1.0.59)

movpotential_ews: 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

Details

Arguments:

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