Code covered by the BSD License  

Highlights from
Compound Poisson simulation

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

Compound Poisson simulation

by

 

08 Dec 2009 (Updated )

benchmarks several versions of code for generating Compound Poisson random variables

| Watch this File

File Information
Description

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).

Acknowledgements

Randraw inspired this file.

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

updated comments

Contact us