Last chance! 50% off unlimited learning
Sale ends in
histolpr(x, weights, bandwidth,
gridsize=512L,range.x,
binned = FALSE, truncate = TRUE)
x
. The weight w_i
of any
observation x_i
should
be non-negative. If x_i=0
, x_i
will be removed
from the analysis.bandwidth
make smoother estimates, smaller values of
bandwidth
make less smooth estimates.x
at which to compute the estimate.
The default is the minimum and maximum data values, extended by the
support of the kernel.TRUE
, data with x
values outside the
range specified by range.x
are ignored.histo
.p = c(.4,.6)
mu = c(34.5,40)
s=c(1.5,1.3)
x = rmixnorm(300,p,mu,s)
x0 = seq(min(x),max(x),length=100)
plot(dmixnorm(x0,p,mu,s)~x0,type='l')
lines(density(x), col=3,lty=3)
out = histolpr(x)
lines(out,col=2,lty=2)
Run the code above in your browser using DataLab