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

Compound Poisson simulation

by Ben Petschel

 

08 Dec 2009 (Updated 10 Dec 2009)

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

The author wishes to acknowledge the following in the creation of this submission:
RANDRAW

Required Products Statistics Toolbox
MATLAB release MATLAB 7.9 (2009b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
10 Dec 2009

updated comments

Tag Activity for this File
Tag Applied By Date/Time
compound poisson Ben Petschel 08 Dec 2009 09:49:17
demo Ben Petschel 08 Dec 2009 09:49:17
efficiency Ben Petschel 08 Dec 2009 09:49:17

Contact us at files@mathworks.com