nchains-ndraws-nvars {mcmcsae} | R Documentation |
Get the number of chains, samples per chain or the number of variables in a simulation object
Description
Get the number of chains, samples per chain or the number of variables in a simulation object
Usage
nchains(obj)
ndraws(obj)
nvars(dc)
Arguments
obj |
an mcdraws object or a draws component (dc) object. |
dc |
a draws component object. |
Value
The number of chains or retained samples per chain or the number of variables.
Examples
ex <- mcmcsae_example(n=50)
sampler <- create_sampler(ex$model, data=ex$dat)
sim <- MCMCsim(sampler, burnin=100, n.iter=300, thin=2, n.chain=5, store.all=TRUE)
# resolve possible conflict with posterior package:
nchains <- mcmcsae::nchains; ndraws <- mcmcsae::ndraws
nchains(sim); nchains(sim$beta)
ndraws(sim); ndraws(sim$beta)
nvars(sim$beta); nvars(sim$sigma_); nvars(sim$llh_); nvars(sim$v)
plot(sim, "beta")
nchains(subset(sim$beta, chains=1:2))
ndraws(subset(sim$beta, draws=sample(1:ndraws(sim), 100)))
nvars(subset(sim$u, vars=1:2))
[Package mcmcsae version 0.7.7 Index]