View source: R/loo.trophicSDMfit.R
loo.trophicSDMfit | R Documentation |
Only works if method = 'stan_glm'. The global loo is computed by summing the loo of all the local models (since the likelihood factorises, the log-likelihood can be summed)This is an implementation of the methods described in Vehtari, Gelman, and Gabry (2017) and Vehtari, Simpson, Gelman, Yao, and Gabry (2019).
## S3 method for class 'trophicSDMfit'
loo(x, ...)
x |
A trophicSDMfit object obtained with trophicSDM() |
... |
additional arguments |
The value of the loo for the whole model
Giovanni Poggiato
data(Y, X, G)
# define abiotic part of the model
env.formula = "~ X_1 + X_2"
# Run the model with bottom-up control using stan_glm as fitting method and no penalisation
m = trophicSDM(Y,X,G, env.formula,
family = binomial(link = "logit"), penal = NULL, iter = 50,
mode = "prey", method = "stan_glm")
brms::loo(m)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.