Subsets an mcmc object by its parameters and/or iterations.
# S3 method for class 'mcmc'
subset(x, iters = NULL, pars = NULL, iterations = NULL, parameters = NULL, ...)
An mcmc object.
Future versions should allow it to be reordered by its parameters.
mcmc <- as_mcmc(nlist(beta = 1:2, theta = 1))
subset(mcmc, pars = "beta")
#> Markov Chain Monte Carlo (MCMC) output:
#> Start = 1
#> End = 1
#> Thinning interval = 1
#> beta[1] beta[2]
#> [1,] 1 2
subset(mcmc, iters = c(1L,1L))
#> Markov Chain Monte Carlo (MCMC) output:
#> Start =
#> End =
#> Thinning interval =
#> beta[1] beta[2] theta
#> [1,] 1 2 1
#> [2,] 1 2 1