Description Usage Arguments Details Value Author(s) Examples
Parameterise species response curves along one or two gradients according to a Gaussian or generalised beta response model.
1 2 3 |
x |
numeric; locations of observations on the primary gradient. |
y |
numeric; locations of observations on the secondary gradient. Can be missing is only a single gradient is required. |
px |
a list of named elements, each of which is a vector of numeric parameter values for the species response on the primary gradient |
py |
a list of named elements, each of which is a vector of numeric parameter values for the species response on the secondary gradient |
corr |
numeric; the correlation between gradients |
Gaussian()
and Beta()
return values from appropriately parameterised Gaussian or generalised beta response models respectively. Parameters for the primary (x
) and secondary (y
) gradients are supplied as lists via arguments px
and py
. Parameters are supplied in the form of vectors, one per parameter. These vectors must be supplied to named components in the respective lists. The names of the components must match the parameters of the required response model.
For Gaussian()
the following named components must be supplied:
the species optima
the species tolerances
the heights of the response curves at the optima. This parameter should only be supplied to px
; in the case of simulations along two gradients, the height of the response curve applies to both gradients and is the hieght of a bivariate Guassian distribution at the bivariate optima.
For Beta()
the following named components must be supplied:
The heights of the species response curves at their modes. Like the parameter h
for the Gaussian response, this parameter should only be passed via px
; in the case of simulations along two gradients, the height of the response curve applies to both gradients and is the height of a bivariate generalised beta distribution at the bivariate mode.
the locations on the gradient of the modal abundance (the species optima)
the ranges of occurrence of species on the gradient
a shape parameter. With gamma
, alpha
informs the shape of the response curve and control the skewness and kurtosis of the curve. Only positive values are allowed, which lead to unimodal response curves. If alpha
is equal to gamma
, the species response curve is symmetric, otherwise an asymmetric curve is generated.
a shape parameter. With alpha
, gamma
informs the shape of the response curve and control the skewness and kurtosis of the curve. Only positive values are allowed, which lead to unimodal response curves. If gamma
is equal to alpha
, the species response curve is symmetric, otherwise an asymmetric curve is generated.
See the examples here and in coenocline
for details on how to set up calls to these species response functions.
A numeric vector of species "abundances" of length equal to length(x)
.
Gavin L. Simpson
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | # A simple example with a single species
x <- seq(from = 4, to = 6, length = 100)
px <- list(opt = 4.5, tol = 0.25, h = 20)
G <- Gaussian(x, px = px)
head(G)
length(G)
# A more complex example with 6 species, which needs the parameters
# repeating for each gradient location:
# Recreate Fig. 2 of Minchin (1987)
# Parameters for each of 6 six species
A0 <- c(5,4,7,5,9,8) * 10
m <- c(25,85,10,60,45,60)
r <- c(3,3,4,4,6,5) * 10
alpha <- c(0.1,1,2,4,1.5,1)
gamma <- c(0.1,1,2,4,0.5,4)
# Gradient locations
x <- 1:100
# expand parameter set
pars <- expand(x, m = m, A0 = A0, r = r, alpha = alpha,
gamma = gamma)
head(pars)
xvec <- pars[, "x"]
px <- as.list(data.frame(pars[, -1]))
spprc <- Beta(xvec, px = px)
matplot(matrix(spprc, ncol = 6), ## 6 species
type = "l", lty = "solid")
# Bivariate beta, single species
xx <- 1:100
yy <- 1:100
xy <- expand.grid(x = xx, y = yy)
parx <- expand(xy[, "x"], A0 = 50, m = 60, r = 40, alpha = 4, gamma = 4)
pary <- expand(xy[, "y"], m = 60, r = 40, alpha = 4, gamma = 4)
x <- parx[,1]
px <- as.list(as.list(data.frame(parx[, -1])))
y <- pary[,1]
py <- as.list(as.list(data.frame(pary[, -1])))
spprc <- Beta(x, y, px = px, py = py)
persp(xx, yy, matrix(spprc, ncol = length(xx)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.