Questions tagged [multinomial]

The multinomial distribution provides a probability distribution over three or more possible outcomes. It generalizes the more fundamental binomial distribution (two outcomes).

In probability theory, the multinomial distribution generalizes the binomial distribution to three or more outcomes.

Suppose two chess players had played numerous games, from which we estimate that Player A would win with probability 0.40, Player B would win with probability 0.35, and the probability that the game ends in a draw is 0.25. The multinomial distribution can be used to answer questions like:

  1. If these two chess players played 12 games, what is the expected number of wins, losses, and draws for player A?
  2. If these two chess players play 3 games, what is the probability that A wins one, B, wins one, and they draw on the other?

Binary classification/prediction methods (such as logistic regression) can also be generalized for multinomial outcomes (i.e., three or more class labels). Multinomial logistic regression is also sometimes called a maximum entropy (MaxEnt) model.

421 questions
1
vote
1 answer

Multinomial Logistic Regression Predictors Set Up

I would like to use a multinomial logistic regression to get win probabilities for each of the 5 horses that participate in any given race using each horses previous average speed. RACE_ID H1_SPEED H2_SPEED H3_SPEED H4_SPEED H5_SPEED…
radio23
  • 87
  • 1
  • 8
1
vote
0 answers

How to change the reference category of the dependent variable in statsmodels when using Multi-nominal Regression?

I am trying to alter the reference category of the dependent variable (what party somebody voted for) while using statsmodels. I know that using C(socialclass, Treatment(reference=2)) allows me to change the reference category of one of the…
1
vote
1 answer

Is there an R function for a multiple group goodness of fit chi squared test?

S.giganteus <- matrix(c(0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 1, 6, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 1, 7, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 6, 6, 0, 0, 0, 0, 0, 0, 2, 3, 0, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 4, 2, 0, 0,…
1
vote
0 answers

Support for frequency weights in an mgcv multinomial GAM fit in R

I was wondering if it is possible to use frequency weights in an mgcv multinomial GAM fit (i.e. using weight=the count of that outcome, Freq below). E.g. for a dataset with 3 outcome levels for VARIANT I was hoping I could do library(mgcv) fit =…
Tom Wenseleers
  • 7,535
  • 7
  • 63
  • 103
1
vote
1 answer

Modelling multinomial dependent variable with longitudinal/panel data (R)

I'm having some trouble with an analyses I want to conduct and were wondering if there are any alternatives. Essentially I have a longitudinal dataset (or panel data), and a dependent variable (group membership) that is categorical and time…
1
vote
0 answers

`gmnl` unable to include Alternative Specific Constants (ASC) in Mixed-mixed MNL model

I am trying to estimate a Mixed-mixed multinomial logit model using the gmnl package. It works perfectly when not including Alternative Specific Constants (ASC), but it produces a weird error when incorporating them. The code below was taken (and…
1
vote
1 answer

Required sample size to detect all sub-groups within a population

I have a population (n=1000), and I know that there are several groups (sub-populations) within it (k=7). This is a multinomial experiment. How do I calculate the minimal N required for drawing at least 1 sample from each group? It is similar to…
1
vote
1 answer

How to use a multinomial logistic regression model to predict future observations

My question seems a little vague so I will provide background context and my reproducible code to try and clarify. I am interested in classifying crime occurrences in various neighbourhoods of a city, based on each neighbourhood's socioeconomic…
1
vote
2 answers

How to compute marginal effects of a multinomial logit model created with the nnet package?

I have a multinomial logit model created with the nnet R package, using the multinom command. The dependent variable has three categories/choice options. I am modelling the probability of selecting a certain irrigation type (no irrigation, surface…
Charlotte
  • 15
  • 6
1
vote
1 answer

How can I resolve this Error - " ValueError: Negative values in data passed to MultinomialNB (input X)

model_3 = MultinomialNB() model_3.fit(X_train,np.ravel(y_train)) y_predict = model_3.predict(X_test) accuracy = metrics.accuracy_score(y_test,y_predict) print(accuracy) I am getting an error: ValueError: Negative values in data passed to…
DSP
  • 33
  • 1
  • 5
1
vote
1 answer

Marginal effects from the multinomial model

I am trying to get the marginal effects from a multinomial model derived from the mlogit package but it shows an error. Can anyone provide some guidance to solve the problem? Many thanks! # data df1 <- structure(list(Y = c(3, 4, 1, 2, 3, 4, 1, 5, 2,…
cliu
  • 933
  • 6
  • 13
1
vote
0 answers

Ordered Probit Model in Ox

I'm learning Ox because it's flexible when it comes to complex econometrics models related to my work. But I'm struggling with my ordered probit model. For a simple probit model (order = 2), the function is as follows: decl g_mX,…
Tande
  • 31
  • 5
1
vote
0 answers

Marginal Effects of conditional logit model in R using, "clogit," function

I am trying to figure out how to calculate the marginal effects of my model using the, "clogit," function in the survival package. The margins package does not seem to work with this type of model, but does work with "multinom" and "mclogit."…
1
vote
1 answer

how to get global p for categorical variables in svy_vglm

I'm using the function svyVGAM::svy_vglm to run a multinomial model with survey weights: mmodel <- svy_glm(y~x1+x2+x3+x4..., family=multinomial, design=w_data) where x represent categorical variables, some with three or more levels. Through model…
MDSF
  • 123
  • 6
1
vote
1 answer

multinomial-hmm using R

I have the following kind of data: df <- data.frame(id = rep(1, each = 40), year = seq(1961,2000), x1 = rbinom(40, size = 1, prob = 1 - 0.6) * rpois(40, lambda = 4), X2 =…
user2246905
  • 1,029
  • 1
  • 12
  • 31