fitbatmix: Fit a mixture of Batschelet distributions

Description Usage Arguments Value Examples

View source: R/BatMixturesFitting.R

Description

This is the main function of the package flexcircmix, and functions as an interface to fit mixtures of Batschelet-type distributions, using frequentist or Bayesian methods.

Usage

1
2
3
4
fitbatmix(x, method = "bayes", bat_type = "power", n_comp = 4L,
  init_pmat = matrix(NA, n_comp, 4L), fixed_pmat = matrix(NA, n_comp,
  4L), probs = c(0.025, 0.975), post_est_median = TRUE, chains = 1L,
  mcmc_parallel = TRUE, ...)

Arguments

x

A dataset of angles in radians.

method

Character; One of "bayes", "EM", or "boot". The method of obtaining a fit.

bat_type

Character; Either "power" or "inverse", denoting the type of Batschelet distribution to employ.

n_comp

The number of components to be used in the mixture. This is fixed, so it can not be estimated.

init_pmat

An n_comp * 4 matrix, the initial values of the parameter matrix. The parameters are ordered mu, kp, lam and then alph.

fixed_pmat

An n_comp * 4 matrix, containing a parameter matrix, with NA for parameters to be estimated, and a numeric for each parameter that should be kept fixed to a specific value.

probs

Numeric vector; The probabilities for which to compute quantiles in summarizing bootstrap or MCMC samples. By default, probs = c(.025, .975), which corresponds to standard 95% confidence or credible intervals.

post_est_median

Logical; Only relevant for MCMC. Whether to use the posterior median as the estimate. If FALSE (the default) we use the mean, or mean direction for mu.

chains

Integer; Only relevant for MCMC. Number of MCMC chains to perform.

mcmc_parallel

Logical; Only relevant for MCMC with chains > 1. If mcmc_parallel = TRUE, multiple MCMC chains will be ran in parallel.

...

Additional arguments to be passed to the selected method. In particular, use verbose = TRUE to print debug statements.

Value

An object of class 'batmixmod'.

Examples

1
2
x <- rinvbatmix(50)
fitbatmix(x, method = "EM")

keesmulder/flexcircmix documentation built on May 29, 2019, 3:02 a.m.