| vmf2 | R Documentation |
Density, distribution function, and random generation for the von Mises-Fisher distribution.
dvmf2(x, theta, log = FALSE)
rvmf2(n, theta)
x |
unit vector or matrix (with each row being a unit vector) of evaluation points |
theta |
direction and concentration vector. The direction of |
log |
logical; if |
n |
number of random values to return. |
In this parameterisation, \theta = \kappa \mu, where \mu is a unit vector and \kappa is the concentration parameter.
dvmf2 allows for automatic differentiation with RTMB. rvmf2 is imported from movMF::rmovMF.
dvmf gives the density and rvm generates random deviates.
set.seed(123)
# single parameter set
theta <- c(1,2,3)
x <- rvmf2(1, theta)
d <- dvmf2(x, theta)
# vectorised over parameters
theta <- matrix(theta, nrow = 1)
theta <- theta[rep(1,10), ]
x <- rvmf2(10, theta)
d <- dvmf2(x, theta)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.