subset.mcmc {nlist}R Documentation

Subset mcmc Object

Description

Subsets an mcmc object by its parameters and/or iterations.

Usage

## S3 method for class 'mcmc'
subset(x, iters = NULL, pars = NULL, iterations = NULL, parameters = NULL, ...)

Arguments

x

An mcmc object.

iters

An integer vector of iterations.

pars

A character vector of parameter names.

iterations

An integer vector (or NULL) of the iterations to subset by.

parameters

A character vector (or NULL) of the parameters to subset by.

...

Unused.

Details

Future versions should allow it to be reordered by its parameters.

Value

An mcmc object.

Examples

mcmc <- as_mcmc(nlist(beta = 1:2, theta = 1))
subset(mcmc, pars = "beta")
subset(mcmc, iters = c(1L,1L))

[Package nlist version 0.3.3 Index]