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

Locate each observation to level by using the probability

I have a matrix of probability. Each row is the probability that observation i is fall in level 1, 2, 3. For example, row 1: this represent the first observation fall in level1 with probability = 0.2 , level2 = 0.3, and level3 = 0.5. At the end I…
Adam
  • 131
  • 6
1
vote
1 answer

How to add a predicted-data column to my dataframe?

I'm using naive bayes to predict country name from a set of addresses, I tried this import re import numpy as np import pandas as pd from sklearn.naive_bayes import MultinomialNB from sklearn.model_selection import train_test_split from…
A.Rahman Mahmoud
  • 328
  • 1
  • 3
  • 17
1
vote
1 answer

Mlogit: how to intrepret model adequacy on fitstat

Two questions regarding mlogit: How exactly do you interpret goodness of fit using fitstat? Is it the R2? or the P-value of LR test? Can the RRR be equated to an odds ratio
Epijam
  • 11
  • 2
1
vote
1 answer

Stata multinomial regression - post-estimation Wald test

I've conducted a multinomial logistic regression analysis in Stata, followed by a Wald test, and was hoping someone could confirm that my code is doing what I think it's doing. NB: I'm using some of Stata's example data to illustrate. The analysis…
Alice
  • 99
  • 1
  • 9
1
vote
0 answers

ChoiceModelR package for conjoint analysis in R error: estimating betas

I've run a conjoint study and now trying to use R package ChoiceModelR to estimate utilities. I've read the package documentation and looked through similar answers/questions on StackOverflow (here and here), but getting the error message below. My…
1
vote
0 answers

Is there an efficient way to generate multinomial random variables in parallel?

numpy.random has the following function to generate multinomial random samples. multinomial(n, p, size) But I wonder if there is an efficient way to generate multinomial samples for different parameters n and p. For example, n = np.array([[10], …
Currurant
  • 11
  • 2
1
vote
0 answers

Can't simulate proportions with known correlation and contrains in R

The problem: I have been sampling 5 categories over 6 months and their effects on certain enviromental activity over the months their proportion has varied like this: | Month| A| B| C| D| …
Derek Corcoran
  • 3,930
  • 2
  • 25
  • 54
1
vote
0 answers

multi class Youden index

I am interested in optimising predictions for a multinomial regression model with 3 (or more) classes according to various measures. For two-class models (logistic regression), this can be done in the pROC package using the coords function with…
Eugenie
  • 11
  • 2
1
vote
1 answer

gmnl latent class model (R) error "Error in t.default(x) : argument is not a matrix"

I try to estimate latent class multinomial logit model from gmnl reference manual examples, it results in error "Error in t.default(x) : argument is not a matrix" Other models (e.g. "mixl") work R version 4.0.2 (2020-06-22) -- "Taking Off…
Maksym
  • 41
  • 3
1
vote
0 answers

How to implement Statsmodels Multinomial Logistic Regression (MNLogit) wald_test()?

I'm (a Python newbie) writing Python code to mimic outputs in SAS and want to run a multinomial logistic regression on the SAS Wallet data set. I've done normal logistic regression previously on other data using statsmodels.Logit, but now am using…
1
vote
0 answers

I try to replicate the results of multinom() function with optim() function in R, but it does not yield the same results. What was wrong?

I want to replicate the results of multinom() function with optim() function in R, but it does not yield the same results. What was wrong? First, I imported a public data as "ml". require(foreign) ml <-…
Shin
  • 11
  • 4
1
vote
1 answer

error with mnLogloss for multinomial classifier using caret/gbm

I am trying to perform a multinomial classifier. It seems to work and I am able to generate a plot with minimized logLoss vs boosting iterations, however I am having trouble extracting the error value. This is the error when I run the mnLogLoss…
gbmforgbm
  • 23
  • 3
1
vote
1 answer

Error in runjags when fitting a multinomial model: "is partly observed and partly missing"

I am new to Jags and I'm trying to fit a multinomial model to my data. When I run the code I get the following error: "positive.counts[1,1:9] is partly observed and partly missing". I googled it and I found that this is due to the fact that a node…
ely
  • 11
  • 2
1
vote
1 answer

How to interpret/tune a multinomial classification with caret-GBM?

Two questions Visualizing the error of a model Calculating the log loss (1) I'm trying to tune a multinomial GBM classifier, but I'm not sure how to adapt to the outputs. I understand that LogLoss is meant to be minimized, but in the below plot,…
gbmforgbm
  • 23
  • 3
1
vote
1 answer

(Why) are standard errors from nnet::multinom scale dependent?

I have noticed that when I increase the scale of a predictor in a multinom() model (function is from nnet R package) the standard errors of other predictors and the intercept approach 0. Can someone tell my why that is? Feel like I'm overlooking…
jhfodr76
  • 95
  • 1
  • 7