Code covered by the BSD License  

Highlights from
multrnd

4.6

4.6 | 5 ratings Rate this file 2 Downloads (last 30 days) File Size: 2.54 KB File ID: #6788

multrnd

by Antonio Trujillo-Ortiz

 

24 Jan 2005 (Updated 26 Jan 2005)

Multinomial random sequence.

| Watch this File

File Information
Description

This m-file generates a random sequence of m simulations of k integers from a multinomial distribution with n trials and k outcomes, where the probability for each simulation is,

                    n!
------------------------- ×p1^n1×p2^n2×..×pk^nk .
n1!×n2!×..×nk!

Then, a single sample {n1, n2, . . . , nk} have a multinomial joint distribution with parameters n and p1, p2, . . . , pk. The parameter n is called the number of trials; the parameters p1, p2, . . . , pk are called the category probabilities; k is called the number of categories.

File needs to input n-number of trials, p-vector of associated probabilities and m-number of simulations (default = 1).

It outputs X-multinomial random deviates (default) and Y-multinomial probabilities of the generated random deviates (optional).

MATLAB release MATLAB 5.3 (R11)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (5)
21 Jul 2005 Jim Rathman

Excellent contribution. It's very strange that the MATLAB Statistics toolbox doesn't include the multinomial distribution. This file is therefore very useful.

27 Jan 2006 Junning Li

It is very useful.
But the code is not very efficient.

28 Sep 2006 chen bw

It is very useful for me.

25 Oct 2006 Anon P

It's very useful.. Mathworks should consider including this module to the statistics toolbox

26 Mar 2007 jyotishka datta  
Please login to add a comment or rating.
Updates
26 Jan 2005

It was added an appropriate format to cite this file.

Tag Activity for this File
Tag Applied By Date/Time
statistics Antonio Trujillo-Ortiz 22 Oct 2008 07:40:09
probability Antonio Trujillo-Ortiz 22 Oct 2008 07:40:09
multinomial distribution Antonio Trujillo-Ortiz 22 Oct 2008 07:40:09
multinomial random numbers Antonio Trujillo-Ortiz 22 Oct 2008 07:40:09

Contact us at files@mathworks.com