Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

vmf.kerncontour

Contour plot of spherical data using a von Mises-Fisher kernel density estimate


Description

Contour plot of spherical data using a von Mises-Fisher kernel density estimate.

Usage

vmf.kerncontour(u, thumb = "none", den.ret = FALSE, full = FALSE, ngrid = 100)

Arguments

u

A two column matrix. The first coolumn is the latitude and the second is the longitude.

thumb

This is either 'none' (defualt), or 'rot' for the rule of thumb suggested by Garcia-Portugues (2013). If it is "none" it is estimated via cross validation, with the fast function "vmfkde.tune_2".

den.ret

If FALSE (default), plots the contours of the density along with the individual points. If TRUE, will instead return a list with the Longitudes, Latitudes and Densities. Look at the 'value' section for details.

full

If FALSE (default), uses the range of positions from 'u' to calculate and optionally plot densities. If TRUE, calculates densities covering the entire sphere.

ngrid

Sets the resolution of the density calculation.

Details

It calcculates the contour plot using a von Mises-Fisher kernel for spherical data only.

Value

The contour lines of the data. If "den.ret" was set to TRUE a list including:

lat

The latitude values.

long

The longitude values.

h

The optimal bandwidth.

den

The kernel density estimate contour points.

Author(s)

Michail Tsagris and Micah J. Waldstein.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr, Giorgos Athineou <gioathineou@gmail.com> and Micah J. Waldstein <micah@waldste.in>.

References

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

Examples

x <- rvmf(100, rnorm(3), 15)
x <- euclid.inv(x)
par( mfrow = c(1, 2) )
vmf.kerncontour(x, "rot")
vmf.kerncontour(x, "none")

Directional

A Collection of R Functions for Directional Data Analysis

v4.9
GPL-2
Authors
Michail Tsagris, Giorgos Athineou, Anamul Sajib, Eli Amson, Micah J. Waldstein
Initial release
2021-03-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.