Learn R Programming

NPCirc (version 3.1.2)

bw.pi: Plug--in rule

Description

This function implements the von Mises scale plug-in rule for the smoothing parameter for density estimation when the number of components in the mixture is selected by Akaike Information Criterion (AIC) which selects the best model between a mixture of 2-5 von Mises distributions.

Usage

bw.pi(x, M=NULL, lower=0, upper=100, np=500, tol=0.1, outM=FALSE)

Value

Vector with the value of the smoothing parameter and the number of components in the mixture (if specified).

Arguments

x

Data from which the smoothing parameter is to be computed. The object is coerced to class circular.

M

Integer indicating the number of components in the mixture. If M=1, the rule of thumb is carried out with \(\kappa\) estimated by maximum likelihood. If M=NULL, AIC will be used.

lower, upper

lower and upper boundary of the interval to be used in the search for the value of the smoothing parameter. Default lower=0 and upper=100.

np

Number of points where to evaluate the estimator for numerical integration. Default np=500.

tol

Convergence tolerance for optimize. Default tol=0.1.

outM

Logical; if TRUE the function also returns the number of components in the mixture. Default, outM=FALSE.

Author

Maria Oliveira, Rosa M. Crujeiras and Alberto Rodriguez--Casal

Details

The value of the smoothing parameter is chosen by minimizing the asymptotic mean integrated squared error (AMISE) derived by Di Marzio et al. (2009) assuming that the data follow a mixture of von Mises distributions. The number of components in the mixture can be fixed by the user, by specifying the argument M or selected by using AIC (default option) as described in Oliveira et al. (2012). The NAs will be automatically removed.

References

Oliveira, M., Crujeiras, R.M. and Rodriguez--Casal, A. (2012) A plug--in rule for bandwidth selection in circular density. Computational Statistics and Data Analysis, 56, 3898--3908.

Oliveira, M., Crujeiras R.M. and Rodriguez--Casal, A. (2014) NPCirc: an R package for nonparametric circular methods. Journal of Statistical Software, 61(9), 1--26. https://www.jstatsoft.org/v61/i09/

See Also

kern.den.circ, bw.rt, bw.CV, bw.boot

Examples

Run this code
set.seed(2012)
n <- 100
x <- rcircmix(n,model=18)
bw.pi(x, M=3)
bw.pi(x, outM=TRUE)  # Using AIC

Run the code above in your browser using DataLab