Description Usage Arguments Value Functions Examples
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).
1 2 3 4 5 | dbesselexp(kp, eta = 1, g = -0.5, log = FALSE)
dbesselexpkern(kp, eta, g, log = FALSE)
rbesselexp(n, eta, g)
|
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, |
g |
Numeric; Should be |
log |
Logical; Whether to return the log of the result. |
n |
Integer; number of generated samples. |
For dbesselexp
and dbesselexpkern
, a scalar. For
rbesselexp
, a vector of random variates from the distribution.
dbesselexp
: Probability density function.
dbesselexpkern
: Kernel (unnormalized version) of the pdf.
rbesselexp
: Random generation.
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))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.