circsizer.density {NPCirc} | R Documentation |
CircSiZer map for density
Description
This function plots the CircSiZer map for circular density estimation based on circular kernel methods, as described in Oliveira et al. (2013). The CircSiZer is an extension of SiZer proposed by Chaudhuri and Marron (1999) to circular data.
Usage
circsizer.density(x, bws, ngrid=250, alpha=0.05, B=500, log.scale=TRUE,
display=TRUE)
## S3 method for class 'circsizer'
print(x, digits=NULL, ...)
Arguments
x |
Data from which the estimate is to be computed. The object is coerced to class |
bws |
Vector of smoothing parameters. Values of |
ngrid |
Integer indicating the number of equally spaced angles between |
alpha |
Significance level for the CircSiZer map. Default |
B |
Integer indicating the number of bootstrap samples to estimate the standard deviation of the derivative estimator. Default |
log.scale |
Logical, if |
display |
Logical, if |
digits |
Integer indicating the precision to be used. |
... |
further arguments |
Details
With CircSiZer, significance features (peaks and valleys) in the data are seeked via the construction of confidence intervals for the scale-space version of
the smoothed derivative curve, as it is described in Oliveira et al. (2013). Thus, for a given point and a given value of the smoothing parameter, the curve
is significantly increasing (decreasing) if the confidence interval is above (below) 0 and if the confidence interval contains 0, the curve for that value
of the smoothing parameter and at that point does not have a statistically significant slope. If display=TRUE
, this information is displayed in a
circular color map, the CircSiZer map, in such a way that, at a given point, the performance of the estimated curve is represented by a color ring with radius
proportional to the value of the smoothing parameter.
Differents colors allow to indentify peaks and valleys. Blue color indicates locations where the curve is significantly increasing; red color shows where it is significantly decreasing and purple indicates where it is not significantly different from zero. Gray color corresponds to those regions where there is not enough data to make statements about significance. Thus, at a given bandwidth, a significant peak can be identified when a region of significant positive gradient is followed by a region of significant negative gradient (i.e. blue-red pattern), and a significant trough by the reverse (red-blue pattern), taking clockwise as the positive sense of rotation.
If log.scale=TRUE
then, the values of the considered smoothing parameters bws
are transformed to -\log_{10}
scale, i.e, a sequence of equally
spaced smoothing parameters according to the parameters
-log10(max(bws))
, -log10(min(bws))
and length(bws)
is used. Hence, small values
of this parameter corresponds with larger rings and large values corresponds with smaller rings. Whereas if log.scale=FALSE
, small values of this
parameter corresponds with smaller rings and large values corresponds with larger rings.
The NAs will be automatically removed.
Value
An object with class circsizer
whose underlying structure is a list containing the following components:
data |
Original dataset. |
ngrid |
Number of equally spaced angles where the derivative of the circular kernel density estimator. |
bw |
Vector of smoothing parameters (given in |
log.scale |
Logical; if |
CI |
List containing: a matrix with lower limits fot the confidence intervals; a matrix with the lower limits of the confidence intervals; a matrix with the Effective Sample Size. Each row corresponds to each value of the smoothing parameter and each column corresponds to an angle. |
col |
Matrix containing the colors for plotting the CircSiZer map. |
If display==TRUE
, the function also returns the CircSiZer map for density.
Author(s)
Maria Oliveira, Rosa M. Crujeiras and Alberto Rodriguez–Casal
References
Chaudhuri, P. and Marron, J.S. (1999). SiZer for exploration of structures in curves, Journal of the American Statistical Association, 94, 807–823.
Oliveira, M., Crujeiras, R.M. and Rodriguez–Casal (2014) CircSiZer: an exploratory tool for circular data. Environmental and Ecological Statistics, 21, 143–159.
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/
See Also
Examples
## Not run:
set.seed(2012)
x <- rcircmix(100,model=7)
sizer <- circsizer.density(x, bws=seq(0,50,length=12))
sizer
names(sizer)
circsizer.map(sizer,type=1,zero=pi/2,clockwise=TRUE,raw.data=TRUE)
## End(Not run)