sampleKappa: Sample a value from the Bessel exponential distribution

Description Usage Arguments Value

View source: R/RcppExports.R

Description

This is an implementation of the algorithm of Forbes and Mardia (2015) to sample from the Bessel exponential distribution, which is the conditional distribution of the concentration parameter of a von Mises distribution given the mean mu. The distribution is proportional to exp(- η g κ)/I_0(κ)^η. Note that beta_0 in Forbes and Mardia (2015) is renamed g here.

Usage

1
sampleKappa(etag, eta)

Arguments

etag

Numeric; This is eta * g, which should -R*cos(mu-theta_bar), where R is the posterior mean resultant length, and theta_bar is the posterior mean, while mu is the current value of the mean.

eta

Integer; This is the posterior sample size, which is n + c where c is the number of observations contained in the conjugate prior. For uninformative, c = 0 and eta = n.

Value

A sampled value kappa from the Bessel exponential distribution.


circglmbayes documentation built on Jan. 22, 2021, 5:09 p.m.