Description Usage Arguments Value Note See Also Examples
Bayesian mean length estimator
1 2 3 |
MLZ_data |
An object with mean length data. Slots |
MLZ_prior |
An object with describing model structure (including priors and the number of change points). |
prior_only |
Logical. If TRUE, only the priors will be sampled in the MCMC. |
chains |
The number of MCMC chains. |
iter |
The number of MCMC iterations. |
warmup |
The number of warmup iterations. |
thin |
The number for which each |
seed |
Integer for random number generation. |
cores |
The number of cores for running the chains in parallel. |
... |
Other arguments to pass to |
An object of class stanfit.
By default, uses the No U-Turn Sampling algorithm for MCMC sampling. The default settings for the number of
total iterations (iter
), warmup iterations (warmup
), and thinning (thin
) are much more conservative
than the rstan defaults. More iterations and thinning may still be needed. Always check for convergence.
stan MLZ_data MLZ_prior plot,stanfit,stanfit-method
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## Not run:
# Create MLZ_data object with mean length data
# Use utility functions in MLZ package
library(MLZ)
data(Goosefish)
# Create an object with priors for a model with 2 change points in mortality (ncp = 2)
default_priors <- new("MLZ_prior", ncp = 2)
# Run the MCMC (calls rstan::sampling)
res <- ML_stan(Goosefish, default_priors)
# All generics for stanfit object from rstan package are available.
stan_trace(res)
stan_dens(res, separate_chains = TRUE)
# Test priors only
res2 <- ML_stan(Goosefish, default_priors, prior_only = TRUE)
stan_dens(res2, separate_chains = TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.