bic_vmf_mix {DirStats} | R Documentation |
Fitting mixtures of von Mises–Fisher distributions
Description
Fitting mixtures of von Mises–Fisher distributions by the Expectation-Maximization algorithm, with determination of the optimal number of mixture components.
Usage
bic_vmf_mix(data, M_bound = ceiling(log(nrow(data))), M_neig = 3,
crit = "BIC", iterative = TRUE, plot_it = FALSE, verbose = FALSE,
kappa_max = 250)
Arguments
data |
directional data, a matrix of size |
M_bound |
bound for the number of components in the mixtures. If it is
not enough, the search for the mixture with minimum |
M_neig |
number of neighbors explored around the optimal number
of mixture components. Defaults to |
crit |
information criterion employed, either |
iterative |
keep exploring higher number of components if the optimum
is attained at |
plot_it |
display an informative plot on the optimization's grid search?
Defaults to |
verbose |
display fitting progress? Defaults to |
kappa_max |
maximum value of allowed concentrations, to avoid numerical
instabilities. Defaults to |
Details
See Algorithm 3 in García-Portugués (2013). The Expectation-Maximization
fit is performed with movMF
.
Value
A list with entries:
best_fit
: a list with estimated mixture parametersmu_hat
,kappa_hat
, andp_hat
of the best-fitting mixture according tocrit
.fit_mixs
: a list with of the fitted mixtures.BICs
: a vector with the BICs (or other information criterion) of the fitted mixtures.
References
García-Portugués, E. (2013). Exact risk improvement of bandwidth selectors for kernel density estimation with directional data. Electronic Journal of Statistics, 7:1655–1685. doi:10.1214/13-ejs821
Hornik, K. and Grün, B. (2014). movMF: An R Package for Fitting Mixtures of von Mises–Fisher Distributions. Journal of Statistical Software, 58(10):1–31. doi:10.18637/jss.v058.i10
Examples
# Sample
q <- 2
n <- 300
set.seed(42)
samp <- rbind(rotasym::r_vMF(n = n / 3, mu = c(rep(0, q), 1), kappa = 5),
rotasym::r_vMF(n = n / 3, mu = c(rep(0, q), -1), kappa = 5),
rotasym::r_vMF(n = n / 3, mu = c(1, rep(0, q)), kappa = 5))
# Mixture fit
bic_vmf_mix(data = samp, plot_it = TRUE, verbose = TRUE)