View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Compound Poisson simulation

Be the first to rate this file! 11 Downloads (last 30 days) File Size: 4.82 KB File ID: #26042 Version: 1.1

Compound Poisson simulation



08 Dec 2009 (Updated )

benchmarks several versions of code for generating Compound Poisson random variables

| Watch this File

File Information

Compound Poisson random variables are of the form S=X1+...+XN where the Xj are iid random variables and N is random with the Poisson distribution. Compound Poisson variables have many applications in physics and finance.

This file benchmarks several codes for generating 1 million random samples from a Compound Poisson distribution where the terms are Lognormal with mu=0 and sigma=1 and the Poisson frequency is 10.

The run times vary by a factor of more than 200 between the fastest and slowest versions (in R2009b). Interestingly, the fastest code is 10 times faster than the neat 1-liner that uses ARRAYFUN.

Requires POISSRND (Statistics Toolbox) and RANDRAW (FEX #7309).


Randraw inspired this file.

Required Products Statistics and Machine Learning Toolbox
MATLAB release MATLAB 7.9 (R2009b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
10 Dec 2009 1.1

updated comments

Contact us