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

Is MNL the right model to use when the choice options vary across observations?

In a survey of 100 people, I am asking each person to choose between product A and product B. I ask each person this question 3 times, but each time I present a different set of products. Say, first time, Person 1 is asked to choose between 'Phone…
0
votes
0 answers

all arguments must have same length

The achievement variable has three different values. All N/A and null values have already been removed from the dataset. When I try to run the confusion matrix code I receive the error "all arguments must have the same length." …
0
votes
0 answers

'list' object has no attribute 'lower'

I am trying to fit this model but I get the error AttributeError: 'list' object has no attribute 'lower'. I know that lower can only be applied on str, but I can't figure out how to solve this problem. X and Y are binary vectors for each text in the…
Mr. Wizard
  • 1,093
  • 1
  • 12
  • 19
0
votes
1 answer

Tensorflow: generate samples from a Multinomial distribution [Space efficient way?]

I have a quick question. How can I sample values in {0, 1} from a Multinomial distribution in TensorFlow? Actually I want a function that does what numpy.multinomial does. Let's assume for example that I have a vector of counts and a vector of…
priseJack
  • 396
  • 2
  • 14
0
votes
0 answers

ML: Multinomial NB error: ValueError: setting an array element with a sequence

I'm pretty new to Machine Learning, and I'm trying something experimental on a public wine dataset. I'm ending up with an error and I can't find a solution. Here is what I'm trying do with my model: X = data_all[['country', 'description', 'price',…
0
votes
0 answers

multinomial logistic regression classifiaction table

I have calculated a multinomial logistic regression using the multinom function with the following code: ####multinomial regression analysis#### MyData <- read.csv(file="Data.csv", header=TRUE, sep=";") ### changes DV to a factor…
Henning
  • 1
  • 1
0
votes
1 answer

ValueError: not enough values to unpack in GridSearch with Scikit

I'm trying to tune the alpha parameter of a Multinomial Naive Bayes, with the 20newsgroups database. This is my code so far: from sklearn.datasets import fetch_20newsgroups from sklearn.feature_extraction.text import CountVectorizer from…
Norhther
  • 545
  • 3
  • 15
  • 35
0
votes
1 answer

error while fitting a hmm.MultinomialHMM with sequences of observed data

I'm trying to fit a multinomial model with my observed data. I have a dataset containing trajectories with different lengths. Since my observations are discrete I try to fit with a multinomial model. The number of observation symbols is 3147 and the…
0
votes
1 answer

Confusion matrix for multinomial logistic regression & ordered logit

I would like to create confusion matrices for a multinomial logistic regression as well as a proportional odds model but I am stuck with the implementation in R. My attempt below does not seem to give the desired output. This is my code so far: CH…
0
votes
2 answers

What's wrong with this simple method to sample from multinomial in C#?

I wanted to implement a simple method to sample from a multinomial distribution in C# (the first argument is an array of integers we want to sample and the second one is the probabilities of selecting each of those integers). When I do this with…
Rohit Pandey
  • 2,443
  • 7
  • 31
  • 54
0
votes
1 answer

Mediation analysis with categorical outcome

I want to run a mediation analysis to see the effect of Exposure to a pollutant (continuous) to types of Cancer (categorical with 4 levels-types of cancer) via a Blood biomarker as the mediator (continuous). So the mediation diagram would be…
0
votes
1 answer

Convergent in multinomial

I hope you don't consider this question as meaningless as I have been struggling with the code and I don't understand why it is not convergent to the same value. I wrote Newtow Raphson R code to estimate the a multinomial logistic model when it…
Falcon-StatGuy
  • 347
  • 2
  • 6
  • 15
0
votes
1 answer

rmultinom() – but transposed?

I want a multinominal distributed data frame with dummies. The probabilities should be applied to the columns. I have following code which seems a bit awkward. Does anyone have a better…
jay.sf
  • 60,139
  • 8
  • 53
  • 110
0
votes
1 answer

Multinomial Logit Model for Panel Data including a Random Term

I do have a panel-data set which can be mimicked by: set.seed(123) N = 1000 X2 = runif(N, 0, 1) X1 = sample(0:6, N, replace=TRUE) eps = rnorm(N, 0, 6) length = sample(1:4,N,replace=TRUE) Ycont = 0.5*X2 - 0.3*X1 +0.2*length + 10 + eps Y =…
Jogi
  • 304
  • 4
  • 15
0
votes
1 answer

Penalized GLM using the glmet - package

Since I have a lot of explanatory variables, I want to perform a penalized estimation of a multinomial logit model. Using the glmnet package, I would proceede as follows: library(glmnet) data(MultinomialExample) cvfit=cv.glmnet(x, y,…
Jogi
  • 304
  • 4
  • 15