1

How do I manually change the coefficient of an R nnet::multinom model object?

I tried :

S = summary(multi_mod)
S$coefficients = coef_hitl

But if I check out the multi_mod object, the coefficient is NOT changed.

Also, is there a nice Matrix format of predicting multinomial logistic regression on a new dataset? Something like this so that I could manually do the prediction?

X * (X'*X)^-1 * X'*y

Nathan Werth
  • 5,093
  • 18
  • 25
Chenying Gao
  • 310
  • 4
  • 14
  • Your code is changing the summary object `S`, not the model. You could try editing `multi_mod$wts` directly, but not sure how well that will work. – Gregor Thomas Dec 01 '17 at 15:21
  • As for for a nice matrix format for multinomial logistic regression, there is no such thing. Even binomial logistic regression doesn't have a general closed form solution. [See here for some details](https://stats.stackexchange.com/q/949/7515). – Gregor Thomas Dec 01 '17 at 15:23

0 Answers0