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
0
votes
1 answer

Multinomial random generation with maximum size in each box

In R, I would like to generate a multinomially distributed random number vector of a given size N, for example using rmultinom, but with a maximum size for each of the K boxes. For example: set.seed(1) draw = rmultinom(n = 1, size = 1000, prob =…
0
votes
1 answer

Replication of best log pseudolikelihood in Stata

I am running a multinomial logistic regression in Stata, and have found that the modelling procedure seems to finish before the log pseudolikelihood is completely replicated: Iteration 0: log pseudolikelihood = -144989.44 Iteration 1: log…
Alice
  • 99
  • 1
  • 9
0
votes
1 answer

TypeError: sparse matrix length is ambiguous; use getnnz() or shape[0]

I'm trying to make multinomial naive bayes classifier without using SKlearn MNB. Here's the code for the classifier : class MultinomialNaiveBayes: def __init__(self): # count is a dictionary which stores several dictionaries corresponding to…
0
votes
0 answers

Randomly assign objects to `K` clusters, according to a Dirichlet Multinomial Distribution

I'm trying to clusterize short documents like, e.g., the following sentences<-c("The color blue neutralizes orange yellow reflections.", "Zod stabbed me with blue Kryptonite.", "Because blue is your favourite colour.", …
Mark
  • 1,577
  • 16
  • 43
0
votes
1 answer

VIF function from "car" package returns NAs when assessing Multinomial Logistic Regression Model

I'm trying to test for multi-collinearity in a multinomial logistic regression model I've set up. The data contains 13 variables on over 33000 observations. 9 of the variables are categorical factor variables and the remaining 3 are…
0
votes
0 answers

Multinom model with ¿partial nesting?

Well, im trying to fit a model with 5 "classes" Controls - DiseaseA_soft - DiseaseA_hard - DiseaseB_soft - DiseaseB_hard. Being soft and hard 2 levels of their prognosis. "Hard" is way severe than "soft". Anyway, i don think a classical "Class ~."…
Galpaccru
  • 57
  • 12
0
votes
0 answers

How to create partial dependence plots for multinomial gbm?

I am trying to create partial dependence plots for my multinomial gbm predictions but I haven't been able to figure out how to produce the correct plots, the ones that I am getting have a single line instead of a line for every level of my response…
0
votes
0 answers

Multinomial Model

I am using Multinomial Model to calculate propability of a variable but when I type function pmultinom() in R, it informs could find function, could you help me what packages should I install in R?
0
votes
1 answer

Wald Test for Multinomial Reg. in R

I asked this question before but never got an answer, so I am trying again and providing a sample data set so someone can tell me why I'm getting the errors I'm getting when I try implementing the Wald Test from aod and lmtest packages. Sample…
Michael
  • 111
  • 9
0
votes
0 answers

Multilevel multinomial logistic regression in matlab

I have been searching for the code in matlab for multilevel multinomial logistic regression for many days. I am new to the matlab, can anyone help me in finding the code for that in matlab?
0
votes
0 answers

Multinomial size parameter bounds in R

In R, when I use rmultinom() I get errors when the size parameter is very big (e.g., 6227020800). Since I would like to study the long term behavior of a random experiment in cases where the size parameter of my multinomial distribution gets really…
GGG
  • 101
0
votes
1 answer

Saving category names of multinomial outcome in model results

I run multinomial logistic regression models in Stata and export the results using the code below: sysuse auto.dta, clear describe summ postfile temp str100 exp str40 outcome adjust N beta se lci uci pval using /// "\test_multinom_models.dta",…
aelhak
  • 441
  • 4
  • 14
0
votes
0 answers

Multinomial/Ordinal hypotheses tests in SAS/R

I'm trying to recreate some SAS output in R. I'm doing ordinal/multinomial regression using the polr and multinom functions from the MASS and nnet packages respectively. The output I want to recreate in R from SAS is the test of the global null via…
Michael
  • 111
  • 9
0
votes
0 answers

Issue using 'relevel' function for a multinomial regression

I am trying to run a multinomial regression on FIFA data. I am trying to predict position based off player attributes. When attempting to set my baseline with the command base = relevel(fifa19$Position, ref = 'ST'), I get the error: Error in…
cap
  • 337
  • 3
  • 14
0
votes
1 answer

Get randomized array of indeces from numpy.random.multinomial

Consider the following documentation example extracting 20 draws of a dice >>> np.random.multinomial(20, [1/6.]*6, size=1) array([[4, 1, 7, 5, 2, 1]]) The output I want is a 20-dimensional array with the indeces of the sampling…
andrea m.
  • 668
  • 7
  • 15