multinomial logit model in rstanarm

423 views
Skip to first unread message

malai...@gmail.com

unread,
Oct 25, 2016, 2:19:59 PM10/25/16
to Stan users mailing list
Hi All,

Just a quick question, is it possible I can the change the logit model to multinomial logit model in rstanarm? or is there a way I can fit my data using the multinomial logit model instead of logit model in rstanarm?

Thanks 

stan_glm1 <- stan_glm(formula = y ~ Intersection_Type + Driver1_Age +Driver1_Gender + Driver2_Age + Driver2_Gender + 
                        Crash_Type + Driver_Turning +Atfault_Lane_Position + Travel_Street + Approach_Through_Lanes +
                        Approach_Left_Turn_Lanes + Approach_Right_Turn_Lanes +Approach_Signal_Type + Crash_Day + 
                        Crash_Time + surfacewidth + medianwidth + AADT + RCI_AVGTFCT + cat_speed + Lighting_Condition +
                        Weather_Condition + Road_Surface_Condition + mediantype +  workzone,
                      data = agingcrashes, 
                      family = binomial('logit'), 
                      chains = 4, 
                      seed = 123, 
                      warmup=2000, 
                      iter = 5000,
                      prior = normal(0,1),
                      prior_intercept = cauchy(0,2.5),
                      QR= TRUE)

Daniel Guhl

unread,
Oct 25, 2016, 2:26:08 PM10/25/16
to stan-...@googlegroups.com
Hi,

brms can fit multinomial logit models using Stan, see https://cran.r-project.org/web/packages/brms/vignettes/brms.pdf

Best, 
Daniel

--
You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
To post to this group, send email to stan-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


malai...@gmail.com

unread,
Oct 25, 2016, 2:44:56 PM10/25/16
to Stan users mailing list
Thanks, let me check that now.

Ben Goodrich

unread,
Oct 25, 2016, 3:20:02 PM10/25/16
to Stan users mailing list
On Tuesday, October 25, 2016 at 2:26:08 PM UTC-4, dg wrote:
brms can fit multinomial logit models using Stan, see https://cran.r-project.org/web/packages/brms/vignettes/brms.pdf

The rstanarm package doesn't have a multinomial logit implemented. We are working on a multinomial probit.

Ben

Stephen Martin

unread,
Nov 20, 2016, 11:05:21 PM11/20/16
to Stan users mailing list
Is there a reason you're implementing multinomial probit instead of multinomial logit?
Just curious, because I fit multinomial logit via stan (using the softmax function with one group's predicted value being set to 0 for scale).

Ben Goodrich

unread,
Nov 20, 2016, 11:58:51 PM11/20/16
to Stan users mailing list
On Sunday, November 20, 2016 at 11:05:21 PM UTC-5, Stephen Martin wrote:
Is there a reason you're implementing multinomial probit instead of multinomial logit?
Just curious, because I fit multinomial logit via stan (using the softmax function with one group's predicted value being set to 0 for scale).

The multinomial logit would certainly be easier but it is hard to get behind the assumption that the errors are independent across choices.
Reply all
Reply to author
Forward
0 new messages