Dataplot Vol 2 Vol 1

# MULTINOMIAL PDF

Name:
MULTINOMIAL PDF
Type:
Let Subcommand
Purpose:
Compute the probability density function for a multinomial distribution.
Description:
The multinomial distribution is a multivariate generalization of the binomial distribution. For a binomial distribution, we perform >n trials where each trial has two mutually exclusive outcomes (labeled success and failure). Each trial has the same probability of success, p. The binomial distribution is the probability of x successes in the n trials.

The multinomial distribution extends this by allowing k possible outcomes. These outcomes are mutually exclusive with each outcome having probability pi The pi must sum to 1 and are the same for each trial. The multinomial distribution is the probability that each event occurs xi times (i = 1, 2, ..., k) in the n trials.

The probability mass function for the multinomial distribution is defined as

where x1 ..., xk are non-negative integers that sum to the number of trials and the pi denote the probabilities of outcome i. The pi should all be in the interval (0,1) and sum to 1.

Syntax:
LET <a> = MULTINOMIAL PDF <x> <p>
where <x> is a non-negative variable specifying the number of times the corresponding outcome occurs;
<p> is a variable (of the same length as <x>) containing the desired probabilities for each outcome;
and where <a> is a parameter where the resulting multinomial pdf is stored.
Examples:
LET P = DATA 0.2 0.1 0.3 0.2 0.2
LET X = DATA 5 4 10 8 7
LET A = MULTINOMIAL PDF X P
Note:
Dataplot uses a Fortran translation of the "gsl_ran_multinomial_lnpdf" code (written by Gavin Crooks) from the GNU GSL library.
Default:
None
Synonyms:
None
Related Commands:
 MULTINOMIAL RANDOM NUMBERS = Generate multinomial random numbers. BINPDF = Compute the binomial pdf function. DIRICHELET PDF = Compute the Dirichelet pdf function.
Reference:
"Statistical Distributions: Third Edition", Evans, Hastings, and Peacock, Wiley, 2000, pp. 134-136.
Applications:
Simulation, Bayesian Analysis
Implementation Date:
2003/5
Program:
```
let p = data 0.2 0.1 0.2 0.3 0.2
let x = data 12 5 8 10 6
.
let a = multinomial pdf x p
.
print a
```
The computed value of a is 0.0002189.

Date created: 7/7/2004
Last updated: 7/7/2004