multimode (version 1.4)

sizer: SIgnificant ZERo crossing

Description

This function provides the SiZer map.

Usage

sizer(data,method=2,bws=NULL,gridsize=NULL,alpha=0.05,B=NULL,n0=NULL,
cbw1=NULL,cbw2=NULL,display=TRUE,logbw=TRUE,from=NULL,to=NULL,logbw.regulargrid=NULL,…)

Arguments

data

Sample in which the SiZer map is computed.

method

The method employed for computing the SiZer map. Available methods are: 1 (q1, pointwise Gaussian quantiles), 2 (q2, approximate simultaneous over x Gaussian quantiles), 3 (q3, bootstrap quantile simultaneous over x) and 4 (q4, bootstrap quantile simultaneous over x and h). Default method=2.

bws

Vector or range of bandwidths. If it is a vector of size two, then it is used a grid of bandwidths between the given values. Default lower bandwidth is twice the grid size used for estimating the density and upper bandwidth equal to the range of the data. Unless it is specified a vector of size greater than two, the number of bandwidths employed is equal to the second element of gridsize.

gridsize

Number of grid points in the horizontal (values of the variable, first element) and vertical (bandwidths, second element) axis. Default is c(512,151).

alpha

Significance level employed for determining the significant features. Default alpha=0.05.

B

Number of replicates used for generating the SiZer map when method q3 or q4 are used. Default B=100.

n0

When the effective sample size is below this quantity, the pixel in the SiZer map is shaded grey. Default n0=5.

cbw1

Number of modes for which the first critical bandwidth is calculated. This is the first bandwidth used to compute the SiZer map when bws is not specified.

cbw2

Number of modes for which the second critical bandwidth is calculated. This is the last bandwidth used to compute the SiZer map when bws is not specified.

display

Logical, if TRUE the SiZer map is plotted. Default TRUE.

logbw

Logical, if TRUE the plot displays and returns the log10 bandwidths. Default logbw=TRUE.

from

First plotted value of the variable. Default is below the data minimum.

to

Last plotted value of the variable. Default is above the data maximum.

logbw.regulargrid

Logical, if TRUE a regular grid of bandwidths is created over the log10 scale. Default logbw.regulargrid=FALSE.

Arguments to be passed to subsequent methods, plot.gtmod for the plot, print and summary methods.

Value

A list with class "gtmod" containing the following components:

sizer

Matrix indicating the significant behavior of the smoothed curve in each location-bandwidth pixel. One indicates significantly decreasing; two, not significantly different from zero; three, significantly increasing and four where the data are too sparse for meaningful inference.

method

A number indicating what type of quantile was performed.

lower.CI

Matrix containig the lower limit of the confidence interval in each location-bandwidth pixel.

estimate

Matrix containing the derivative values of the kernel density estimation in each location-bandwidth pixel.

upper.CI

Matrix containig the upper limit of the confidence interval in each location-bandwidth pixel.

ESS

Matrix containing the Effective Sample Size in each location-bandwidth pixel.

range.x

Employed location values to represent the SiZer map.

range.bws

Employed bandwidths to compute the SiZer map.

logbw

Logical value indicating if the bandwidths are given in the log10 scale.

sample.size

The number of non-missing observations in the sample used for obtaining the SiZer map.

call

The unevaluated expression, which consists of the named function applied to the given arguments.

Details

With this function the assessment of SIgnificant ZERo crossing of the derivative of the smoothed curve are computed for the sample given in data. For this calculation, a kernel density estimator with Gaussian kernel and bandwidths bws is used. When it is plotted, at a given location (horizontal axis) and using a specified bandwidth parameter (vertical axis), the SiZer map represents where the curve is significantly increasing (blue color by default), decreasing (red by default) or not significantly different from zero (orchid, a light tone of purple, by default). Thus, for a given bandwidth, a region significantly increasing followed by a region significantly decreasing (blue-red pattern by default) indicates where there is a significant peak.

For methods q2, q3 and q4, it is calculated where the data are too sparse for meaningful inference (grey color by default). A location-bandwidth pixel is classified in this last category when the estimated Effective Sample Size is less than n0. For more information, see Chaudhuri and Marron (1999).

For methods q3 and q4, the bootstrap quantiles are computed generating B random samples drawn with replacement from data.

The NAs will be automatically removed.

References

Chaudhuri, P. and Marron, J. S. (1999). SiZer for exploration of structures in curves, Journal of the American Statistical Association, 94, 807--823.

Examples

Run this code
# NOT RUN {
#SiZer map using a grid of bandwidths between 1 and 10
data(geyser)
data=geyser
sizer(data,bws=c(1,10))

# }
# NOT RUN {
#Different methods for calculating the confidence limits

#Pointwise Gaussian quantiles
sizer(data,method=1,bws=c(1,10))

#Approximate simultaneous over x Gaussian quantiles
sizer(data,method=2,bws=c(1,10))

#Bootstrap quantile simultaneous over x
sizer(data,method=3,bws=c(1,10))

#Bootstrap quantile simultaneous over x and h
sizer(data,method=4,bws=c(1,10))
# }
# NOT RUN {
#Adding the original mode tree for this sample
modetree(data,bws=c(0.8,10),logbw=TRUE,addplot=TRUE,col.lines="white")

# }

Run the code above in your browser using DataLab