vm2_mle {BAMBI}R Documentation

Maximum likelihood estimation of bivariate von Mises parameters

Description

Maximum likelihood estimation of bivariate von Mises parameters

Usage

vm2_mle(data, model = c("vmsin", "vmcos"), ...)

Arguments

data

data matrix (if bivarate, in which case it must have two columns) or vector. If outside, the values are transformed into the scale [0, 2\pi). *Note:* BAMBI cannot handle missing data. Missing values must either be removed or properly imputed.

model

Bivariate von Mises model. One of "vmsin", "vmcos" or "indep".

...

Additional arguments. See details.

Details

The parameters kappa1 and kappa2 are optimized in log scales. The method of optimization used (passed to optim) can be specified through method in ... (defaults to "L-BFGS-B"). Note, however, that lower (0) and upper (2*pi) bounds for mu1 and mu2 are specified; so not all methods implemented in optim will work.

Value

An object of class mle-class.

Examples

pars <- list(kappa1 = 3, kappa2 = 2, kappa3 = 1.5, mu1 = 0.5, mu2 = 1.5)
nsamp <- 2000
model <- "vmsin"
set.seed(100)
dat_gen <- do.call(paste0("r", model), c(list(n = nsamp), pars))

est <- vm2_mle(dat_gen, model = model)
library(stats4)
coef(est)
vcov(est)

[Package BAMBI version 2.3.5 Index]