Open 123xiao4 opened 2 years ago
Hello, It is a well-known fact that FMR is identifiable up to a permutation. What you see is that the place of Component 1 and Component 2 is exchanged which is common in FMR. If you want to get the correct order, try to use different initial values for mixing proportions, say c(0.2, 0.8). This will result in correct order in the fit.
I'm confused that the estimate of the mixprop is so different from the true value. It looks like the order of the esimate of the mixprop is reversed. In the following code, the true value of mixprop is 0.3 and 0.7, but the estimate is 0.6896571 and 0.3103429. ` nComp = 2 nCov = 10 nObs = 500 dispersion = c(1, 1) mixProp = c(0.3, 0.7) rho = 0.5 coeff1 = c(1,1,0,0,3,0,1,0.6, 0, 3, 0) coeff2 = c(2,-1,2,0,0,3,-1, 0, 0, 4, .7) umax = 40
dat <- fmrs.gendata(nObs = nObs, nComp = nComp, nCov = nCov, coeff = c(coeff1, coeff2), dispersion = dispersion, mixProp = mixProp, rho = rho, umax = umax, disFamily = "norm") res.mle <- fmrs.mle(y = dat$y, x = dat$x, delta = dat$delta, nComp = nComp, disFamily = "norm", initCoeff = rnorm(nComp*nCov+nComp), initDispersion = rep(1, nComp), initmixProp = rep(1/nComp, nComp))
Mixlasso
res.lam1 <- fmrs.tunsel(y = dat$y, x = dat$x, delta = dat$delta, nComp = nComp, disFamily = "norm", initCoeff = c(coefficients(res.mle)), initDispersion = dispersion(res.mle), initmixProp = mixProp(res.mle), penFamily = "lasso") res.var1 <- fmrs.varsel(y = dat$y, x = dat$x, delta = dat$delta, nComp = ncomp(res.mle), disFamily = "norm", initCoeff=c(coefficients(res.mle)), initDispersion = dispersion(res.mle), initmixProp = mixProp(res.mle), penFamily = "lasso", lambPen = slot(res.lam1, "lambPen")) mixProp(res.var1) Comp.1 Comp.2 [1,] 0.6896571 0.3103429
`