0

I'm trying to understand how to use multinomial-dist in Gamble. From the Gamble documentation:

Represents a multinomial distribution. The support consists of vectors of the same length as weights representing counts of n iterated samples from the corresponding categorical distribution with weights for weights.

So if I understood correctly writing (define test (multinomial-dist 100 (vector 50 40 10))) defines a multinomial distribution in which, out of 100 samples, outcome 1 appeared 50 times, outcome 2 appeared 40 times and outcome 3 appeared 10 times. What I'm struggling to understand is that if I evaluate (sample test) I could obtain results like '#(51 88 100) and I can't really understand what these numbers mean. I know that probably is an easy question, but I really can't find the answer anywhere else. Thank you very much.

Kamugg
  • 1
  • I think the documentation describes what's happening in a nested way, so you have to start at the end of the sentence and work backwards. Your `(vector 50 40 10)` is the weights for "the corresponding _categorical_ distribution", from which you need "counts of n iterated samples" as input to `multinomial-dist`. – mnemenaut May 08 '22 at 16:49
  • Thanks for your answer. I tried `(define test (multinomial-dist 3 (vector 0.7 0.1 0.2)))` and by evaluating `(sample test)` I obtained as output `'#(3, 1, 3)`, could you help me interpreting what does this means? Thank you kindly – Kamugg May 08 '22 at 18:48

0 Answers0