circ.plugin.hdr {HDiR} | R Documentation |
Circular plug-in estimation of HDRs and confidence regions
Description
This function computes the circular plug-in estimator of HDRs and confidence regions in Saavedra-Nieves and Crujeiras (2021).
Usage
circ.plugin.hdr(sample,bw=bw.CV(circular(sample),upper=100),tau=NULL,
tau.method="quantile",level=NULL,conf=.95,plot.hdr=TRUE,
plot.hdrconf=TRUE,boot=FALSE,k=3,col=NULL,lty=NULL,shrink=NULL,
lwd=NULL,pch=NULL,cex=NULL)
Arguments
sample |
Numeric vector of angles in radians. |
bw |
Smoothing parameter to be used. It can be a numeric value directly selected by the user. Following Oliveira et al. (2014), the value of the smoothing parameter could be also chosen by using the functions |
tau |
Numeric probability. According to Saavedra-Nieves and Crujeiras (2021), |
tau.method |
Character value selecting the rule to estimate the threshold of the HDR. This must be one of |
level |
Numeric threshold of the HDR provided by the user. When |
conf |
Numeric value between 0 and 1 corresponding to the confidence for limits on HDR. Default |
plot.hdr |
Logical string. If |
plot.hdrconf |
Logical string. If |
boot |
Logical string. If |
k |
Positive integer value that controls if the confidence region is plotted near (large values of |
col |
Color number for plotting the HDR. Default |
lty |
A numeric value indicating the line type to represent the threshold of HDR. Line type can be specified as an integer (0=blank, 1=solid (default), 2=dashed, 3=dotted, 4=dotdash, 5=longdash, 6=twodash). Default |
shrink |
Parameter that controls the size of the plotted circle. Default is 2. Larger than 1 values shrink the circle, while smaller values enlarge the circle. |
lwd |
A number indicating the line width for drawing symbol. Default |
pch |
Point type. Default is |
cex |
Point character size for representing the data on the scatterplot. Default is |
Details
A detailed definition of plug-in estimators for directional HDRs is given in Saavedra-Nieves and Crujeiras (2021). The density quantile algorithm proposed in Hyndman (1996) or the numerical integration method of trapezoidal rule can be used to compute the threshold of HDR. The confidence region for the estimated HDR is calculated also following Hyndman (1996).
Value
If tau
is provided, a list with the next components:
hdr |
Boundaries of the HDR. |
prob.content |
Probability coverage |
level |
Threshold associated to the probability content |
bw |
Value of the smoothing parameter used for kernel density estimation. |
hdr.lo |
HDR corresponding to lower confidence limit. |
level.lo |
Threshold associated to the lower confidence limit. |
hdr.hi |
HDR corresponding to upper confidence limit. |
level.hi |
Threshold associated to the upper confidence limit. |
If level
is provided, a list with the next components:
levelset |
boundaries of the level set or a character indicating if the level set is equal to the emptyset or the support distribution. |
prob.content |
Probability coverage |
level |
Threshold of the level set. |
bw |
Value of the smoothing parameter used for kernel density estimation. |
Author(s)
Paula Saavedra-Nieves and Rosa M. Crujeiras.
References
Hyndman, R.J. (1996). Computing and graphing highest density regions, The American Statistician, 50, 120-126.
Oliveira, M., Crujeiras. R.M. and RodrÃguez-Casal, A. (2014). NPCirc: An R Package for Nonparametric
Circular Methods, Journal of Statistical Software, 61, 1-26.
Saavedra-Nieves, P. and Crujeiras, R. M. (2021). Nonparametric estimation of directional highest density regions. Advances in Data Analysis and Classification, 1-36.
Examples
# Plug-in HDR for orientations of saltator specie in April and October
data(sandhoppers)
attach(sandhoppers)
#Orientations in October
saltatorO<-angle[(species=="salt")&(time=="afternoon")&(sex=="M")&(month=="October")]
circ.plugin.hdr(sample=saltatorO,tau=0.8,plot.hdrconf=FALSE)
#Orientations in April
saltatorA<-angle[(species=="salt")&(time=="afternoon")&(sex=="M")&(month=="April")]
circ.plugin.hdr(sample=saltatorA,tau=0.8,plot.hdrconf=FALSE)
#HDR confidence bands for model 5 in NPCirc package
library(NPCirc)
set.seed(1)
sample<- rcircmix(500, model=5)
circ.plugin.hdr(sample,bw=bw.CV(circular(sample),upper=100),tau=0.6)