Learn R Programming

BAMBI (version 2.3.5)

quantile.angmcmc: Quantile estimates for parameters from an angmcmc object

Description

Quantile estimates for parameters from an angmcmc object

Usage

# S3 method for angmcmc
quantile(x, par.name, comp.label, chain.no, probs = seq(0, 1, 0.25), ...)

Value

Returns a three dimensional array of quantiles, or a matrix (vector) of quantiles if one (or two) among par.name, comp.label, probs has length 1.

Arguments

x

angmcmc object

par.name

vector of names of parameters for which point estimates are to be computed. If NULL, results for all parameters are provided.

comp.label

vector of component labels (positive integers, e.g., 1, 2, ...) for which point estimates are to be computed. If NULL, results for all components are provided.

chain.no

vector of chain numbers whose samples are to be be used. in the estimation. By default all chains are used.

probs

numeric vector of probabilities with values in \([0,1]\). (Values up to 2e-14 outside that range are accepted and moved to the nearby endpoint.)

...

further arguments to pass to quantile. In particular, probs = seq(0, 1, 0.25) is the default vector of quantiles computed for each parameter.

Examples

Run this code
# first fit a vmsin mixture model
# illustration only - more iterations needed for convergence
fit.vmsin.20 <- fit_vmsinmix(tim8, ncomp = 3, n.iter =  20,
                             n.chains = 1)
# 0.025th quantiles
(quant_025 <- quantile(fit.vmsin.20, prob = 0.025))
# 0.975th quantiles
(quant_975 <- quantile(fit.vmsin.20, prob = 0.975))
# default quantiles
(quant_def <- quantile(fit.vmsin.20))

Run the code above in your browser using DataLab