Description Usage Arguments Value See Also Examples
densgen
generates a function which calculates
a kernel density estimate for a prescribed mixture component
at a given set of points.
1 |
xs |
a |
m |
a number of component whose density is estimated. |
Kern |
a function which calculates the kernel values at given points (must be vectorized). |
a function
f(x,h)
which calculates the estimate at points given in the
vector x
with the bandwidth h
.
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.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.