subset.coalescentMCMC: Subset MCMC Output

View source: R/coalescentMCMC.R

subset.coalescentMCMCR Documentation

Subset MCMC Output

Description

This function helps to manipulate outputs from coalescentMCMC, particularly it sets the attributes correctly (unlike if you would use [).

Usage

## S3 method for class 'coalescentMCMC'
subset(x, burnin = 1000, thinning = 10, end = NULL, ...)

Arguments

x

an object of class "coalescentMCMC".

burnin

an integer: the number of generations to drop.

thinning

an integer: the sampling frequency.

end

an integer: the generations after end are removed.

...

(unused)

Details

This function has more or less the same effect than the standard indexing operator ([). The main difference is that the attributes attached to the output from coalescentMCMC are not lost.

The options end may help to focus on one part of the MCMC (see examples).

Value

an object of class "coalescentMCMC".

Note

The default values of burnin and thinning are only indicative: it is recommended to use functions in the package coda to help find appropriate values (see examples).

Author(s)

Emmanuel Paradis

See Also

acfplot, effectiveSize

Examples

## Not run: 
data(woodmouse)
res <- coalescentMCMC(woodmouse, 1e6, moves = c(1, 3)) # ~ 1 hr
plot(res) # surely hard to read
plot(subset(res, end = 1e3)) # plot only the first 1000 generations

acfplot(res)
acfplot(subset(res, 1e4, 100))

## End(Not run)

coalescentMCMC documentation built on April 22, 2022, 5:05 p.m.