silvbw: Silverman's rule of thumb for bandwidth selection

Description Usage Arguments Details Value See Also Examples

Description

silvbw calculates quasi-optimal bandwidth for kernel density estimate by weighted sample based on the mixture with varying concentrations approach

Usage

1
silvbw(xs, m, delta = 1.7188)

Arguments

xs

a wtsamp object representing a sample with distributions of different components.

m

a number of component for which the density is estimated.

delta

the canonical bandwidth of the kernel used in the estimate.

Details

The default value of delta=1.7188 corresponds to the Epanechnikov kernel.

Value

a numeric value of the Silverman's optimal bandwidth.

See Also

Maiboroda R., Sugakova O. "Statistics of mixtures with varying concentrations with application to DNA microarray data analysis". Nonparametric statistics (2012) v.24:1, p. 201 - 215.

Examples

1
2
3
4
5
6
7
8
9
#' @examples
set.seed(3)
p <- genunifp(1000,2) # create mixing probabilities
a <- lsweight(p) # calculate minimax weights
# create a weighted sample:
xs <- wtsamp(genormixt(p,c(0,1),c(1,1)),indiv=a)
f<-densgen(xs,1) # create the estimator
h<-silvbw(xs,1) # calculates the bandwidth by the Silverman's rule
curve(f(x,h),-3,3) # plot the graph (estimates N(0,1) density)

RostyslavMaiboroda/mixvconc documentation built on June 12, 2019, 12:34 a.m.