Learn R Programming

BayesianFirstAid (version 0.1)

as.matrix.bayesian_first_aid: Returns the MCMC samples from a Bayesian First Aid fit as a matrix.

Description

Returns a matrix with the MCMC samples from a Bayesian First Aid Object. The samples does not include the burn in phase and all chains are collapsed in the resulting matrix.

Usage

"as.matrix"(x, ...)

Arguments

x
The output from a Bayesian First Aid model.
...
Not used

Value

A matrix with one column per parameter.

Details

This is just a wrapper for the as.matrix from the coda package. Therefor, paramameters with the same name but different index will be column names that includes brackets (for example, "mu[1]", "mu[2]", "sigma[1,2], etc.)

Examples

Run this code
fit <- bayes.t.test(rnorm(10), rnorm(10))
d <- as.matrix(fit)
mean(d[,"mu_x"])

Run the code above in your browser using DataLab