View source: R/kern.den.circ.R
kern.den.circ | R Documentation |
This function computes the kernel density derivative estimate with the given kernel and bandwidth for circular data.
kern.den.circ(x,z=NULL,bw="AA",deriv.order=0,kernel="vonmises",na.rm = FALSE, from = circular(0), to = circular(2 * pi),n = 512,control.circular=list())
x |
Data from which the estimate is to be computed. The object is coerced to class |
z |
Points where the density derivative is estimated. If |
bw |
Smoothing parameter to be used. |
deriv.order |
Derivative order. Default |
kernel |
a character string giving the smoothing kernel to be
used. This must be one of |
na.rm |
logical; if |
from, to |
the left and right-most
points of the grid at which the density is to be estimated. The objects are coerced to class |
n |
the number of equally spaced points at which the density is to be estimated. |
control.circular |
the attribute of the resulting objects ( |
An object with class density.circular
whose
underlying structure is a list containing the following components.
data |
original dataset. |
x |
the |
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 |
has.na |
logical, for compatibility (always FALSE). |
Jose Ameijeiras-Alonso.
Ameijeiras-Alonso, J. (2022) A reliable data-based smoothing parameter selection method for circular kernel estimation.
Di Marzio, M., Panzera, A., & Taylor, C. C. (2011). Kernel density estimation on the torus. Journal of Statistical Planning and Inference, 141(6), 2156–2173.
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/
bw.AA
, plot.density.circular
, lines.density.circular
, bw.pi
, bw.rt
, bw.CV
, bw.boot
set.seed(2022) n <- 50 x <- rcircmix(n, model=13) # Using the smoothing parameter by default, # i.e., 2-stage solve-the-equation plug-in rule est1 <- kern.den.circ(x,deriv.order=1) # Selecting the smoothing parameter: 2-stage direct plug-in rule est2 <- kern.den.circ(x, bw="dpi", deriv.order=1) # Circular plot plot(est1, plot.type="circle", points.plot=TRUE, shrink=1.4, main="Circular plot",ylab="Density derivative circular") lines(est2, plot.type="circle", shrink=1.4 ,col=2) # Linear plot plot(est1, plot.type="line", main="Linear plot",ylab="Density derivative circular") lines(est2, plot.type="line", col=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.