# besselexp: Bessel exponential distribution In keesmulder/flexcircmix: Fit Mixtures of Flexible Circular Distributions

## Description

Functions for the Bessel exponential distribution. This is the conditional posterior distribution of the concentration parameter `kappa` of a von Mises distribution with conjugate prior. The random generation algorithm is due to Forbes and Mardia (2015).

## Usage

 ```1 2 3 4 5``` ```dbesselexp(kp, eta = 1, g = -0.5, log = FALSE) dbesselexpkern(kp, eta, g, log = FALSE) rbesselexp(n, eta, g) ```

## Arguments

 `kp` Numeric; value of kappa to evaluate. `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`. `g` Numeric; Should be `-R*cos(mu-theta_bar)/eta`, where `R` is the posterior mean resultant length, and `theta_bar` is the posterior mean, while `mu` is the current value of the mean. Note that this parameter is called β_0 in Forbes and Mardia (2015). `log` Logical; Whether to return the log of the result. `n` Integer; number of generated samples.

## Value

For `dbesselexp` and `dbesselexpkern`, a scalar. For `rbesselexp`, a vector of random variates from the distribution.

## Functions

• `dbesselexp`: Probability density function.

• `dbesselexpkern`: Kernel (unnormalized version) of the pdf.

• `rbesselexp`: Random generation.

## Examples

 ```1 2 3 4 5 6 7 8 9``` ```dbesselexp(2, 20, -.5) plot(density(rbesselexp(100, 20, -.5)), xlim = c(0, 5)) # Plot probability density function dbesexpfun <- Vectorize(function(x) dbesselexp(x, 20, -.5)) curve(dbesexpfun, 0, 5) # Compare with density of random draws plot(density(rbesselexp(1000, 20, -.5)), xlim = c(0, 5)) ```

keesmulder/flexcircmix documentation built on May 29, 2019, 3:02 a.m.