subset.coalescentMCMC {coalescentMCMC} | R 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 |
burnin |
an integer: the number of generations to drop. |
thinning |
an integer: the sampling frequency. |
end |
an integer: the generations after |
... |
(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
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)