kern.den.circ {NPCirc}R Documentation

Nonparametric circular kernel density estimation

Description

This function computes circular kernel density estimates with the given bandwidth, taking the von Mises distribution as circular kernel.

Usage

kern.den.circ(x, t=NULL, bw=NULL, from=circular(0), to=circular(2*pi), len=250)

Arguments

x

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

t

Points where the density is estimated. If NULL equally spaced points are used according to the parameters from, to and len.

bw

Smoothing parameter to be used. The value of the smoothing parameter can be chosen by using the functions bw.rt, bw.CV, bw.pi and bw.boot.

from, to

Left and right-most points of the grid at which the density is to be estimated. The objects are coerced to class circular.

len

Number of equally spaced points at which the density is to be estimated.

Details

The NAs will be automatically removed.

Value

An object with class density.circular whose underlying structure is a list containing the following components:

data

Original dataset.

x

The points where the density is estimated.

y

The estimated density values.

bw

The smoothing parameter used.

N

The sample size after elimination of missing values.

call

The call which produced the result.

data.name

The deparsed name of the x argument.

has.na

Logical, for compatibility (always FALSE).

Author(s)

Mar?a Oliveira, Rosa M. Crujeiras and Alberto Rodr?guez–Casal

References

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

Taylor, C.C. (2008) Automatic bandwidth selection for circular density estimation. Computational Statistics and Data Analysis, 52, 3493–3500.

Oliveira, M., Crujeiras R.M. and Rodr?guez–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

bw.rt, bw.CV, bw.pi, bw.boot, plot.density.circular, lines.density.circular

Examples

set.seed(2012)
n <- 100
x <- rcircmix(n, model=14)
est1 <- kern.den.circ(x, t=NULL, bw=NULL)
plot(est1, plot.type="circle", points.plot=TRUE, shrink=1.2, main="Circular plot")
est2 <- kern.den.circ(x, t=NULL, bw=20)
lines(est2, plot.type="circle",shrink=1.2,col=2)
plot(est1, plot.type="line", main="Linear plot")
lines(est2, plot.type="line", col=2)

[Package NPCirc version 3.0.1 Index]