sampleKappa: Sample a value from the Bessel exponential distribution

View source: R/RcppExports.R

sampleKappaR Documentation

Sample a value from the Bessel exponential distribution

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

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.


keesmulder/CircGLMBayes documentation built on July 21, 2022, 3:43 a.m.