View source: R/ct_rest_select_stay.R
| ct_rest_select_stay | R Documentation |
Fits the REST staying-time survival sub-model under one or more candidate
distributions (and, optionally, covariate combinations) and ranks them by
WAIC, with a Bayesian p-value as a goodness-of-fit check. Use the winning
stay_distribution in ct_fit_rest().
ct_rest_select_stay(
stay_data,
species,
stay_formula = Stay ~ 1,
stay_distribution = c("lognormal", "gamma", "weibull", "exponential"),
stay_random_effect = NULL,
compare_models = FALSE,
iterations = 5000,
burnin = 1000,
thin = 4,
chains = 3,
cores = 3,
quiet = FALSE
)
stay_data |
Staying-time data from |
species |
Single species name to analyse. |
stay_formula |
Staying-time formula, e.g. |
stay_distribution |
One or more of |
stay_random_effect |
Optional column in |
compare_models |
If |
iterations, burnin, thin, chains, cores |
MCMC settings. |
quiet |
If |
An object of class ct_rest_stay with a waic ranking tibble, a
summary of the mean staying time for the best model, and its samples.
ct_fit_rest()
data(rest_detection)
data(rest_station)
stay <- ct_rest_stay(rest_detection, rest_station)
## Not run:
# Compare candidate staying-time distributions by WAIC (requires 'nimble')
ct_rest_select_stay(
stay, species = "Red duiker",
stay_distribution = c("lognormal", "gamma", "weibull"),
iterations = 3000, burnin = 1000, chains = 2, cores = 2
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.