bic_vmf_mix | R Documentation |
Fitting mixtures of von Mises–Fisher distributions by the Expectation-Maximization algorithm, with determination of the optimal number of mixture components.
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)
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 |
See Algorithm 3 in García-Portugués (2013). The Expectation-Maximization
fit is performed with movMF
.
A list with entries:
best_fit
: a list with estimated mixture parameters
mu_hat
, kappa_hat
, and p_hat
of the best-fitting
mixture according to crit
.
fit_mixs
: a list with of the fitted mixtures.
BICs
: a vector with the BICs (or other information criterion)
of the fitted mixtures.
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. \Sexpr[results=rd]{tools:::Rd_expr_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. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v058.i10")}
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.