View source: R/sphere.scatterplot.R
sphere.scatterplot | R Documentation |
This function produces a spherical scatterplot with points coloured according to the HDRs in which they fall.
sphere.scatterplot(sample,tau=c(0.25,0.5,.75),bw="none", ngrid=500,nborder=1000,tol=0.1, col=NULL)
sample |
A matrix whose rows represent points on the unit sphere in Cartesian coordinates. If a row norm is different from one, a message appears indicating that they must be standardized. |
tau |
Numeric vector of probabilities. According to Saavedra-Nieves and Crujeiras (2021), |
bw |
Smoothing parameter to be used. According to |
ngrid |
Sets the resolution of the density calculation. Default |
nborder |
Maximum number of HDRs boundary points to be represented. Default |
tol |
Tolerance parameter to determinate the boundary of HDRs. Default |
col |
Vector containing the color numbers for plotting the scatterplot. If |
A detailed definition of directional HDRs and of their plug-in estimators is given in Saavedra-Nieves and Crujeiras (2021).
Package Directional
is used to compute tha von Mises-Fisher kernel density estimate.
The density quantile algorithm proposed in Hyndman (1996) is used to calculate the threshold of HDR.
The scatterplot is created colouring the sample points according to which HDR they fall.
A scatterplot showing the points coloured according to which HDR they fall. Futhermore, a list where the number of components is equal to the number HDR estimated or, equivalently, to the length of tau vector. Each component contains the sample points in each HDR from the smallest value of tau to the biggest one.
Paula Saavedra-Nieves and Rosa M. Crujeiras.
García-Portugués, E. (2013). Exact risk improvement of bandwidth selectors for kernel density
estimation with directional data. Electronic Journal of Statistics, 7, 1655-1685.
Tsagris, M., Athineou, G., Sajib, A., Tsagris, M. M. and Imports, M. A. S. S. (2016). Package Directional
. https://cran.r-project.org/package=Directional.
Saavedra-Nieves, P. and Crujeiras, R. M. (2021). Nonparametric estimation of directional highest density regions. Advances in Data Analysis and Classification, 1-36.
# Scatterplot of model 4 in library HDiR set.seed(1) sample=rspheremix(1000,model=4) sphere.scatterplot(sample,tau=c(.2,.5,.8)) #Scatterplot of model 9 in library HDiR set.seed(1) sample=rspheremix(1000,model=9) sphere.scatterplot(sample)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.