# NOT RUN {
library(POUMM)
set.seed(1)
N <- 1000
# create a random non-ultrametric tree of N tips
tree <- ape::rtree(N)
# Simulate the evolution of a trait along the tree
z <- rVNodesGivenTreePOUMM(
tree, g0 = 8, alpha = 1, theta = 4, sigma = 1.2, sigmae = .8)
fit <- POUMM(z[1:N], tree, spec = list(nSamplesMCMC = 4e5))
# Summarize the results from the fit in a table:
summary(fit)
# Create plots for some of the inferred parameters/statistics:
pl <- plot(fit, stat = c("alpha", "theta", "sigma", "sigmae", "H2tMean"),
doZoomIn = TRUE,
zoomInFilter = paste("!(stat %in% c('alpha', 'sigma', 'sigmae')) |",
"(value >= 0 & value <= 8)"),
doPlot = FALSE)
pl$traceplot
pl$densplot
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab