multinomial logistic regression (mnrfit) with fisher's iris data - MATLAB issue?

3 views (last 30 days)
So i have been writing my own code to perform a multinomial logistic regression. I have been using MATLABs mnrfit to check that the MLE's agree. All seems to work well. I can simulate data, fit using both mnrfit and my code and the estimates agree. However when i use fisheriris data, used in MATLAB's example (<http://www.mathworks.com/help/stats/mnrfit.html>) our estimates do not agree. In fact if i look at the value of the likelihood using mnrfit's parameter estimates it is no where near its maximum. I can not understand why?
In addition when i reconstruct the probabilities using the parameter estimates from my code, i find that for flower setosa all of the probabilities are 1. Not so under mnrfit. And since this data set is commonly used to demonstrate discriminant analysis this result seems more likely. I also wonder why the probit example given in glmfit (<http://www.mathworks.com/help/stats/glmfit.html?searchHighlight=glmfit>) uses only the latter 2 species in fisheriris
Can anyone comment on this? Anyone from Mathworks care to comment? I am quite confused. Thanks

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!