vmf {DirStats} | R Documentation |
Von Mises–Fisher distribution utilities
Description
Maximum likelihood estimation for the von Mises–Fisher distribution and evaluation of density mixtures.
Usage
kappa_ml(data, min_kappa = 1e-04, max_kappa = 100, ...)
mu_ml(data)
d_mixvmf(x, mu, kappa, p, norm = FALSE)
Arguments
data |
directional data, a matrix of size |
min_kappa , max_kappa |
minimum and maximum kappas to look for the maximum likelihood estimate. |
... |
further parameters passed to |
x |
evaluation points, a matrix of size |
mu , kappa , p |
mixture parameters. |
norm |
enforce normalization of |
Value
Estimated vector mean (mu_ml
) or concentration parameter
(kappa_ml
). A vector of length nx
for d_mixvmf
.
Examples
# Sample
n <- 50
q <- 2
samp <- rotasym::r_vMF(n = n, mu = c(1, rep(0, q)), kappa = 2)
# Estimates
mu_ml(samp)
kappa_ml(samp)
# Mixture
x <- to_cir(seq(0, 2 * pi, l = 200))
dens <- d_mixvmf(x = x, mu = rbind(c(-1, 0), c(0, 1), c(1, 0)),
kappa = 1:3, p = c(0.5, 0.2, 0.3))
plot(to_rad(x), dens, type = "l")
[Package DirStats version 0.1.10 Index]