pointest {BAMBI}R Documentation

Point estimates for parameters from an angmcmc object

Description

Point estimates for parameters from an angmcmc object

Usage

pointest(object, fn = mean, par.name, comp.label, chain.no, ...)

Arguments

object

angular MCMC object.

fn

function, or a single character string specifying its name, to evaluate on MCMC samples to estimate parameters. Defaults to mean, which computes the estimated posterior mean. Note that if fn = "MODE" (warning: not "mode") or fn = "MAP", then the maximum aposteriori estimate (MAP) is calculated.

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.

...

additional arguments to be passed to the function.

Value

Returns a matrix of point estimates, or vector of point estimates if length(par.name)==1 or length(comp.label)==1.

Examples

# 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)
# estimate parameters by sample mean
(est_mean <- pointest(fit.vmsin.20))
# estimate parameters by sample median
(est_median <- pointest(fit.vmsin.20, fn = median))
# estimate parameters by MAP
(est_median <- pointest(fit.vmsin.20, fn = "MODE"))

[Package BAMBI version 2.3.5 Index]