search for: flxmrglm

Displaying 6 results from an estimated 6 matches for "flxmrglm".

Did you mean: flxglm
2011 Feb 28
1
mixture models/latent class regression comparison
...however, the results for basic Poisson latent class regression appear to be inferior to the results from flexmix. Below is a simple reproducible example to illustrate the comparison: library(flexmix) library(mmlcr) data(NPreg) # from package flexmix m1 <- flexmix(yp ~ x, k=2, data=NPreg, model=FLXMRglm(family='poisson')) NPreg$id <- 1:200 # mmlcr requires an id column m2 <- mmlcr(outer=~1|id, components=list(list(formula=yp~x, class="poisonce")), data=NPreg, n.groups=2) # summary and coefficients for flexmix model summary(m1) summary(refit(m1)) # summary and coefficients...
2008 Jan 07
0
Help with flexmix
Hello, I am using the package "flexmix", specifically the function "stepFlexmix" and was hoping for some assistance: Here is my input: fit <- stepFlexmix(trips~.,data=data.frame(traveldata),k=1:5,nrep=5,model=FLXMRglm( family="gaussian")) And I recieve the following error message: *Error in FLXfit(model = model, concomitant = concomitant, control = control, : 1 Log-likelihood: NA I'm not sure how to interpret this error. Any advice would be helpful. Thank you. mw Marion Wittmann...
2009 Dec 04
0
flexmix and mclust help
...I want to use R. I then tried to understand and use flexmix assuming the data are actually better described as a gamma mixture. From what I could understand of the function call I wrote flextest <- flexmix( Data ~ unmap(priors_from_kmeans_call$cluster), data=Data, k = number_clusters, model = FLXMRglm(family = "Gamma" ) ) and found Error in model.frame.default(model at fullformula, data = data, na.action = NULL) : invalid type (list) for variable 'chr18_test_binned' I think it wants a "list" (like NPreg in the examples, a "struct" in MATLAB), but I'...
2010 Jul 15
1
KLdiv question (data.frame)
Hi all, I wonder why KLdiv does not work with data.frames: n <- 50 mydata <- data.frame( sequence=c(1:n), data1=c(rnorm(n)), data2=c(rnorm(n)) ) # does NOT work KLdiv(mydata) # works fine dataOnly <- cbind(mydata$data1, mydata$data2, mydata$group) KLdiv(dataOnly) Any ideas? Is there a better implementation that can deal with data.frame or is there a simpler way of converting? Ralf
2011 Dec 21
0
Estimating a latent class multinomial logit regression with flexmix
I am trying to estimate a latent class multinomial logit regression with flexmix. I am not sure if I should do it as follows: m4<-flexmix(cbind(y,1-y)~x1+x2|id,model=FLXMRglm(family="binomial"),data=NPreg,k=2) , where id links each row with the corresponding respondent. Each respondent has 4 alternatives to chose from. y takes the value 1 only for the alternative chosen; x1 and x2 are alternative-specific variables (thus they take different values in each...
2011 Feb 28
0
Gamma mixture models with flexmix
...', '))) cols <- rainbow(KK) for (ii in 1:KK) { lines(x, y[[ii]], col=cols[ii]) } } ## ## Model dat as a mixture of Gammas then plot. ## modelGammas <- function(dat, which='BIC') { set.seed(939458) fmo <- stepFlexmix(dat ~ 1, k=1:3, model=FLXMRglm(family='Gamma')) mdl <- getModel(fmo, which=which) print(smry <- summary(mdl)) print(prm <- parameters(mdl)) plotGammaMixture(dat, prm['shape', ], prm['shape', ]*prm['coef.(Intercept)', ], smry at comptab[, '...