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
2
votes
0 answers

How to go from summarized data to raw data

I first want to generate multinomially distributed data using r, and then I want the data in its "raw" form. So for an example, say that I have generated data by set.seed(1) df <- as.data.frame(cbind(rmultinom(1, 13, c(0.1, 0.3, 0.4, 0.2)),…
test.data
  • 21
  • 3
2
votes
2 answers

How to calculate multi class classification AUC with labels?

I am using pROC (in R) with the function multiclass.roc as pointed out at the thread How to plot ROC curves in multiclass classification? However, when I applied to my data, there is an error: predictor must be numeric or ordered Obviously my…
mamatv
  • 3,581
  • 4
  • 19
  • 25
2
votes
0 answers

Ranked choices in R: result analysis

Please consider the following sample data set: a <- c(1, 2, 3, 1, 4, 1968, 2, 1) b <- c(2, 1, 2, 4, 3, 1984, 2, 0) c <- c(3, 3, 4, 2, 1, 1945, 1, 0) d <- c(4, 1, 4, 3, 2, 1975, 3, 1) df <- data.frame(rbind(a,b,c,d)) names(df) <- c("ID", "OptionW",…
Achu Mani
  • 133
  • 3
2
votes
1 answer

Prediction using mboost multinomial logistic regression in R

I am trying to use the mboost package in R to apply a multinomial logistic regression model. I found this example online but I added the "newdata = iris" in the predict function to see how the prediction formula worked in mboost for new data. I am…
Lorcan Treanor
  • 561
  • 1
  • 7
  • 19
2
votes
0 answers

Predict to raster multinomial gbm

Currently, it looks as through it is not possible to predict out to a rasterbrick a multinomial gbm model. See however that there is an easy way around this for relatively small raster grids - which is explained below. But the process here is very…
Allen
  • 21
  • 3
2
votes
0 answers

R nnet multiniom (multinomial logistic regression models) - assign penalties to avoid misclassification

I am using multinom from nnet package to fit a logistic regression model to data consists of 3 classes, however the prevalence of the classes is not balanced. I would like to assign weight/penalties in order to tell the model to avoid…
user3628777
  • 529
  • 3
  • 10
  • 20
2
votes
1 answer

Marginal effects in a multinomial logit model with dummy interaction

I have a multinomial model with binary variables that includes an interaction term. When I run my regression as: mlogit x y x#y, I get sensible output with an estimate for the interaction term at values (0 1) and with two ommissions at (1 0) and (1…
user2898391
  • 217
  • 2
  • 8
2
votes
1 answer

Sampling without Replacement using Scala and Breeze

Is there support for sampling from a multinomial distribution without replacement? I'm imagining some sort of code like: import breeze.linalg._ import breeze.stats.distributions._ val params = DenseVector(0.1, 0.3, 0.2, 0.4) val mult = new…
sinwav
  • 724
  • 1
  • 7
  • 20
2
votes
1 answer

Using Multinomial Distribution with Scala and Breeze package

I'm using the breeze package with Scala 2.10.3, and I'd like to sample from a multinomial distribution. I.e. I'd like to sample values of a random variable Y, where Y ~ Multinomial(Y1 = 0, Y2 = 1, Y3 = 3; p1 = 0.2, p2 = 0.5, p3 = 0.3) I'm having…
sinwav
  • 724
  • 1
  • 7
  • 20
2
votes
1 answer

How to use predict with multinom() with intercept in R?

I have run the multinom() function in R, but when I try to predict on a new sample, it keeps giving an error. this is the code: library(nnet) dta=data.frame(replicate(10,runif(10))) names(dta)=c('y',paste0('x',1:9)) res4 <- multinom(y ~…
DaReal
  • 597
  • 3
  • 10
  • 24
2
votes
2 answers

How to interpret the output of choicemodelr (rhierMnlRwMixture) in R

My Problem I just started using the R library 'choicemodelr' and succeded in getting some beta values as a solution. But I wonder how do I assign these values to the specific attribute-levels. As a result I only get values for A1B1, A1B2, A1B3,...…
phil
  • 21
  • 3
2
votes
2 answers

R gbm() function - RAM not released? memory leak?

i am running the gbm() function for multiple additive multinomial models with 6 response categories each on a large dataset (~ 0.5-1 mio. lines per model). The model is like this (pretty much the defaults). gbm <- gbm(Y ~ A + B + C + D + E + F, …
Schw4rz
  • 207
  • 1
  • 2
  • 7
1
vote
1 answer

Multinomial regression with R; can't find some statistics

I'm currently running multinomial logistic regressions with R using nnet package; multinom function. I have 16 IV and one DV. Using the tbl_regression function i can get the contribution of each DV to my model (odds ration; CI; p value), but I can't…
1
vote
0 answers

Obtaining predicted probabilities from multinomial logistic regression using coefficients as input (not the model)

I wonder if R has a function that can compute the predicted probabilities from the multinomial logistic regression coefficients (not the model), assuming that we do not have the model and what we have are multinomial logistic coefficients only.
Nader Mehri
  • 514
  • 1
  • 5
  • 21
1
vote
0 answers

MultinomialLogit() with xlogit - ValueError: inconsistent 'y' values. Make sure the data has one choice per sample

I'm learning about multinomial logit and I have a problem running this code using xlogit. # Long format from xlogit.utils import wide_to_long ATUS_data_LA_2020_Long = wide_to_long(ATUS_data_LA_2020_wide, id_col='custom_id', alt_name='alt', sep='_', …
Catalina V
  • 13
  • 3