fit.mixnorm {bda} | R Documentation |
Fit a finite normal mixture model for pre-binned data
fit.mixnorm(x,k,mu,s,p, x.range,lognormal=FALSE)
x |
Ungrouped or grouped data |
k |
number of components |
mu,s,p |
Initial parameters of the Normal components. |
x.range |
The range of |
lognormal |
An indicator shows whether or not to fit a normal mixture for log-normal data. |
If the data are top-headed (or truncated), nl, nu
will used to store the frequencies of the lower and uper bins.
If the data are not truncated, the two variables will be used
to return the predicted frequencies in these two bins instead.
B. Wang bwang@southalabama.edu
AS 254, ...
y <- c(10, 21, 56,79,114,122,110,85,85,61,47,49,47,44,31,20,11,4,4) x <- 14.5 + c(0:length(y)) x.hist <- binning(counts=y, breaks=x) mu <- c(20.0, 26.0) p <- c(0.5, 0.5) sig <- c(2.0, 2.8) out <- fit.mixnorm(x.hist,mu=mu, p=p, s=sig)