Last data update: 2014.03.03

R: Kernel density estimation of circular data with a von Mises...
vm.kdeR Documentation

Kernel density estimation of circular data with a von Mises kernel

Description

Kernel density estimation of circular data with a von Mises kernel.

Usage

vm.kde(u, h, thumb = "none", rads = TRUE)

Arguments

u

A numeric vector containing the data.

h

The bandwidth.

thumb

It can be either "none", so the bandwidth the user has set will be used, "tay" for the method of Taylor (2008) or "rot" for the method of Garcia-Portugues (2013).

rads

If the data are in radians, this should be TRUE and FALSE otherwise.

Details

The user has the option to use a bandwidth he/she has found in some way (cross-validation) or estimate it as Taylor (2008) or Garcia-Portugues (2013).

Value

A list including:

h

The bandwidth. If the user chose one of "tay" or "rot" the estimated bandwidth will be returned.

f

The kernel density estimate at the observed points.

Author(s)

Michail Tsagris

R implementation and documentation: Michail Tsagris <mtsagris@yahoo.gr> and Giorgos Athineou<athineou@csd.uoc.gr>

References

Taylor, C. C. (2008). Automatic bandwidth selection for circular density estimation. Computational Statistics & Data Analysis, 52(7): 3493-3500.

Garcia Portugues, E. (2013). Exact risk improvement of bandwidth selectors for kernel density estimation with directional data. Electronic Journal of Statistics, 7, 1655-1685.

See Also

vmkde.tune, vmfkde.tune, vmf.kde

Examples

x <- rvonmises(100, 2.4, 10, rads = TRUE)
hist(x, freq = FALSE)
f1 <- vm.kde(x, h = 0.1, thumb = "rot", rads = TRUE)$f
f2 <- vm.kde(x, h = 0.1, thumb = "tay", rads = TRUE)$f
h <- vmkde.tune(x)[1]
f3 <- vm.kde(x, h = h, thumb = "none", rads = TRUE)$f
points(x, f1, col = 1)
points(x, f2, col = 2)
points(x, f3, col = 3)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(Directional)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/Directional/vm.kde.Rd_%03d_medium.png", width=480, height=480)
> ### Name: vm.kde
> ### Title: Kernel density estimation of circular data with a von Mises
> ###   kernel
> ### Aliases: vm.kde
> ### Keywords: Kernel density von Mises kernel
> 
> ### ** Examples
> 
> x <- rvonmises(100, 2.4, 10, rads = TRUE)
> hist(x, freq = FALSE)
> f1 <- vm.kde(x, h = 0.1, thumb = "rot", rads = TRUE)$f
> f2 <- vm.kde(x, h = 0.1, thumb = "tay", rads = TRUE)$f
> h <- vmkde.tune(x)[1]
> f3 <- vm.kde(x, h = h, thumb = "none", rads = TRUE)$f
> points(x, f1, col = 1)
> points(x, f2, col = 2)
> points(x, f3, col = 3)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>