densgen: Generator of kernel density estimator for mixture components.

Description Usage Arguments Value See Also Examples

Description

densgen generates a function which calculates a kernel density estimate for a prescribed mixture component at a given set of points.

Usage

1
densgen(xs, m, Kern = Epanechn)

Arguments

xs

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

m

a number of component whose density is estimated.

Kern

a function which calculates the kernel values at given points (must be vectorized).

Value

a function f(x,h) which calculates the estimate at points given in the vector x with the bandwidth h.

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
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
f(c(0,1),1)      # calculate the estimate at two points
curve(f(x,1),-3,3) # plot the graph (estimates N(0,1) density)

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