coef.mcmc.list {dclone} | R Documentation |
Functions and methods for 'mcmc.list' objects.
dcsd(x, na.rm = FALSE) as.mcmc.list.dc(x, ...) ## S3 method for class 'mcmc.list': coef(object, ...) ## S3 method for class 'mcmc.list.dc': confint(object, parm, level = 0.95, ...) ## S3 method for class 'mcmc.list.dc': vcov(object, ...) ## S3 method for class 'mcmc.list': quantile(x, ...)
x, object |
MCMC object to be processed. |
na.rm |
Logical, if NA s should be removed.
|
parm |
A specification of which parameters are to be given confidence intervals, either a vector of numbers or a vector of names. If missing, all parameters are considered. |
level |
The confidence level required. |
... |
Further arguments passed to functions. |
dcsd
returns the data cloning standard errors of a posterior MCMC chain
calculated as standard deviation times the square root of the number of clones.
The function as.mcmc.list.dc
creates a data cloning version of
an 'mcmc.list' object
The coef
method returns mean of the posterior MCMC chains
for the monitored parameters.
The confint
method returns confidence intervals for the parameters
assuming asymptotic normality.
The vcov
method returns the inverse of the Fisher information matrix.
The quantile
method returns quantiles for each variable.
Some functions only available for the 'mcmc.list.dc' class which inherits from
class 'mcmc.list'. Such statistics for Bayesian models are available
after coercion by the function as.mcmc.list.dc
, but the frequentis meaning
of the statistics will not be applicable.
P\'eter S\'olymos, solymos@ualberta.ca
## Not run: ## simple regression example from the JAGS manual jfun <- function() { for (i in 1:N) { Y[i] ~ dnorm(mu[i], tau) mu[i] <- alpha + beta * (x[i] - x.bar) } x.bar <- mean(x) alpha ~ dnorm(0.0, 1.0E-4) beta ~ dnorm(0.0, 1.0E-4) sigma <- 1.0/sqrt(tau) tau ~ dgamma(1.0E-3, 1.0E-3) } ## data generation set.seed(1234) N <- 100 alpha <- 1 beta <- -1 sigma <- 0.5 x <- runif(N) linpred <- model.matrix(~x) %*% c(alpha, beta) Y <- rnorm(N, mean = linpred, sd = sigma) ## data for the model dcdata <- dclone(list(N = N, Y = Y, x = x), 5, multiply = "N") ## data cloning dcmod <- jags.fit(dcdata, c("alpha", "beta", "sigma"), jfun, n.chains = 3) summary(dcmod) coef(dcmod) dcsd(dcmod) confint(dcmod) vcov(dcmod) quantile(dcmod) ## End(Not run)