I have installed the mixdist package in R to combine distributions. Specifically, I'm using the mix()
function. See documentation.
Basically, I'm getting
Error in nlm(mixlike, lmixdat = mixdat, lmixpar = fitpar, ldist = dist, :
missing value in parameter
I googled the error message, but no useful results popped up.
My first argument to mix()
is a data frame called data.df. It is formatted exactly like the built-in data set pike65. I also did data.df <- as.mixdata(data.df)
.
My second argument has two rows. It is a data frame called datapar, formatted exactly like pikepar. My pi
values are 0.5 and 0.5. My mu
values are 250 and 463 (based on my data set). My sigma
values are 0.5 and 1.
My call to mix()
looks like:
fitdata <- mix(data.df, datapar, "norm", constr = mixconstr(consigma="CCV"), emsteps = 3, print.level = 2)
The printing shows that my pi
values go from 0.5 to NaN after the first iteration, and that my gradient is becoming 0.
I would appreciate any help in sorting out this error.
Thanks,
n.i.