This function helps to manipulate outputs from
coalescentMCMC
, particularly it sets the attributes
correctly (unlike if you would use [
).
# S3 method for coalescentMCMC
subset(x, burnin = 1000, thinning = 10, end = NULL, ...)
an object of class "coalescentMCMC"
.
an integer: the number of generations to drop.
an integer: the sampling frequency.
an integer: the generations after end
are removed.
(unused)
an object of class "coalescentMCMC"
.
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).
# 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))
# }
Run the code above in your browser using DataLab