getPostStats: getPostStats

Description Usage Arguments Value Examples

View source: R/getPostMean.R

Description

Given a posterior of MCMC samples from a BayesTraits analysis (a logfile - typically with the .log.txt extension) and the name of one or morea parameters present in that logfile this will return the mean, median, mode and standard deviation of the parameter estimates.

Usage

1
getPostStats(logfile, params, thinning = 1, burnin = 0)

Arguments

logfile

The name of the logfile of the BayesTraits analysis.

params

The name(s) of one or more parameters present in the logfile.

thinning

Thinning parameter for the posterior - defaults to 1 (all samples). 2 uses every second sample, 3 every third and so on.

burnin

The number of generations to remove from the start of the chain as burnin. Use if the chain has not reached convergence before sampling began. Useful if the burnin parameter for the analysis itself was not long enough.

Value

An object of class data.frame with a row for each parameter, and columns for the mean, median, mode and standard deviation of those parameters.

Examples

1
2
3
params <- getParams("cool-data.log.txt")
getPostMean("cool-data.log.txt", params[c(2:5)]
getPostMean("cool-data.log.txt", "Lh")

hferg/bayestraitr documentation built on May 28, 2019, 8:55 p.m.