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

Multinomial Naive Bayes Classifier

I have been looking for a multinomial naive Bayes classifier on CRAN, and so far all I can come up with is the binomial implementation in package e1071. Does anyone know of a package that has a multinomial Bayes classifier?
Timothy P. Jurka
  • 918
  • 1
  • 11
  • 21
6
votes
2 answers

Fast vectorized multinomial in python

I am currently using NumPy for the following task: I have a large grid of values and I need to take a multinomial sample at each point. The probability vector for the multinomial will vary from grid site to grid site, so the NumPy multinomial…
algol
  • 399
  • 3
  • 15
6
votes
0 answers

Adding splines to a multinomial logit model using mgcv

I am trying to train a multinomial logit model and while I am at it I might as well make it a GAM and add splines to the mix. I have tried using mgcv, but I have only managed to generate errors so far. Below are some examples using the iris…
Zoltan
  • 760
  • 4
  • 15
6
votes
1 answer

scipy Multinomial pmf return nan

I'm trying to use the multinominal.pmf function from scipy.stats (python). When I use this function where all probabilities in the input bigger than zero, it work fine. The problem is when I want to use the function when one of the probabilities is…
rfire
  • 165
  • 1
  • 11
6
votes
1 answer

Multinomial logit models and nested logit models

I am using the mlogit package in program R. I have converted my data from its original wide format to long format. Here is a sample of the converted data.frame which I refer to as 'long_perp'. All of the independent variables are individual…
marcellt
  • 501
  • 5
  • 14
6
votes
1 answer

multinomial mixed logit model mlogit r-package

I discovered the mlogit-package for multinomial logit models in search of estimating a multinomial mixed logit model. After reading the excellent vignette I discovered that I could not apply my data on any of the described examples. I now write in…
schlusie
  • 1,907
  • 2
  • 20
  • 26
6
votes
2 answers

How to display "beautiful" glm and multinom table with Rmd and Knit HTML?

When I perform a multinom reg. I have difficulties to get a nice summary with Rmd and and Knit HTLM (Rstudio). I would like to know how to get a nice summary as if I use the stargazer package with LaTeX... (cf. printscreen) Summary output difficult…
S12000
  • 3,345
  • 12
  • 35
  • 51
5
votes
1 answer

Functionally is torch.multinomial the same as torch.distributions.categorical.Categorical?

For example, if I provide a probability array of [0.5, 0.5], both functions will sample the index [0,1] with equal probability?
Mzq
  • 1,796
  • 4
  • 30
  • 65
5
votes
2 answers

How to get confidence intervals for predicted probability plot using {ggeffects} based on nnet::multinom() model?

I want to plot the predicted probabilities for a multinomial model in R, fitted with the nnet::multinom() function. I have numerical predictors on the log scale. Even though {ggeffects} should be compatible with multinom(), the plot does not display…
5
votes
1 answer

Bayesian Multinomial Regression using rjags package

I am trying to fit a multinomial logistic regression model using rjags for the outcome is a categorical (nominal) variable (Outcome) with 3 levels, and the explanatory variables are Age (continuous) and Group (categorical with 3 levels). In doing…
Minh Chau
  • 83
  • 4
5
votes
1 answer

pymc3 : Dirichlet with multidimensional concentration factor

I am struggling with implementing a model where the concentration factor of the Dirichlet variable is dependent on another variable. The situation is the following: A system fails due to faulty components (there are three components, only one fails…
Hugo
  • 53
  • 4
5
votes
3 answers

Assesing the goodness of fit for the multinomial logit in R with the nnet package

I use the multinom() function from the nnet package to run the multinomial logistic regression in R. The nnet package does not include p-value calculation and t-statistic calculation. I found a way to calculate the p-values using the two tailed…
Koba
  • 1,514
  • 4
  • 27
  • 48
5
votes
1 answer

How to set specific contrasts in multinom() in nnet package?

I have a 3-class problem that needs classification. I want to use the multinomial logistic regression in nnet package. The Class outcome has 3 factors, P, Q, R. I want to treat Q as the base factor. So I tried to write it the contrasts like this: …
doctorate
  • 1,381
  • 1
  • 19
  • 43
4
votes
1 answer

Faster way to calculate the Hessian / Fisher Information Matrix of a nnet::multinom multinomial regression in R using Rcpp & Kronecker products

It appears that for larger nnet::multinom multinomial regression models (with a few thousand coefficients), calculating the Hessian (the matrix of second derivatives of the negative log likelihood, also known as the observed Fisher information…
Tom Wenseleers
  • 7,535
  • 7
  • 63
  • 103
4
votes
2 answers

glmnet for feature selection when the number of classes is more than two (family = "multinomial")

As is commonly known glmnet can be used as a tool for feature selection. A toy example: library(glmnet) # Binomial dataset, the number of classes is 2 data(BinomialExample) # data truncation to 10 columns, just to make the example dataset smaller x…
artgram
  • 144
  • 4
1
2
3
27 28