View source: R/pred.error.bands.R
pred.error.bands | R Documentation |
This function plots the response curves showing the effect of the predictors (i.e. trait-based and neutral forces) on joint occupancy as the response variable, with prediction error bands (as the standard deviation from the mean of the response variable) for all orders of joint occupancy.
pred.error.bands(
s.data,
t.data,
p.d.mat,
metric = "Simpson_eqn",
gbsm.model,
d.f = 4,
simm = 10,
orders,
degree = 3,
n = 1000,
max.vif = 40,
max.vif2 = 30,
start.range = c(-0.1, 0)
)
s.data |
A species-by-site presence/absence |
t.data |
A |
p.d.mat |
A symmetric |
metric |
As for gbsm_m.orders. |
gbsm.model |
As for gbsm_m.orders. |
d.f |
As for gbsm_m.orders. |
simm |
Number of Monte Carlo simulations performed |
orders |
As for gbsm_m.orders |
degree |
As for gbsm_m.orders. |
n |
As for gbsm_m.orders. |
max.vif |
As for gbsm. |
max.vif2 |
As for gbsm. |
start.range |
As for gbsm_m.orders. |
pred.error.bands
function returns:
predictors |
a |
responses |
a |
responses.sim_stats |
a |
the response curves with prediction error bands for all orders of joint occupancy
Lagat, V. K., Latombe, G. and Hui, C. (2021a). A multi-species co-occurrence
index to avoid type II errors in null model testing. DOI: <To be added>
.
Lagat, V. K., Latombe, G. and Hui, C. (2021b). Dissecting the effects of random
encounter versus functional trait mismatching on multi-species co-occurrence and
interference with generalised B-spline modelling. DOI: <To be added>
.
## Not run:
my.path <- system.file("extdata/gsmdat", package = "msco")
setwd(my.path)
s.data <- get(load("s.data.csv")) ## Species-by-site matrix
t.data <- get(load("t.data.csv")) ## Species-by-Trait matrix
p.d.mat <- get(load("p.d.mat.csv")) ## Species-by-species phylogenetic distance matrix
RNGkind(sample.kind = "Rejection")
set.seed(1)
pe <- msco::pred.error.bands(s.data, t.data, p.d.mat, metric="Simpson_eqn", d.f=4, simm=10,
orders = c(2:5, 8, 10, 15), degree=3, n=1000, gbsm.model, start.range=c(-0.2, 0))
pe$predictors$`order 2`
pe$responses$`order 2`
pe$responses.sim_stats$`order 2`
pe$predictors$`order 3`
pe$responses$`order 3`
pe$responses.sim_stats$`order 3`
pe$predictors$`order 10`
pe$responses$`order 10`
pe$responses.sim_stats$`order 10`
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.