Code covered by the BSD License  

Highlights from
randp.m

Be the first to rate this file! 13 Downloads (last 30 days) File Size: 10.09 KB File ID: #24904
image thumbnail

randp.m

by Matthew Roughan

 

02 Aug 2009

Generate Pareto random variables.

| Watch this File

File Information
Description

This function generates Pareto random variables (of type I). See
   "Statistical Distributions", Evans, Hastings and Peacock, Wiley, 1993
or http://www.maths.adelaide.edu.au/matthew.roughan/probability_distrns/node6.html
or http://en.wikipedia.org/wiki/Pareto_distribution

 The Pareto distribution is a classic "heavy-tailed" or "power-law" distribution. It has distribution function
    F(x) = 1 - (b/x)^alpha, for x>=b
and density
    f(x) = (alpha/b) * (b/x)^(alpha+1), for x>=b

Its mean is
    E[X] = b * alpha/(alpha-1), for alpha>1
but note that the mean is infinite for alpha<=1

Its variance is
    Var(X) = b^2 * alpha/[(alpha-1)^2*(alpha-2)], for alpha>1
but note that the variance is infinite for alpha<=2

Median
  Med(X) = b * 2^(1/alpha)

Note the function calls "rand" so if you want to control the seed, use rand('state', seed).

Also note that the type II Pareto is just shifted so that x>=0, so to obtain this distributio just take
            x = randp(N,M,alpha,b) - b;

MATLAB release MATLAB 7.4 (R2007a)
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.
Tag Activity for this File
Tag Applied By Date/Time
statistics Matthew Roughan 03 Aug 2009 11:47:07
random number Matthew Roughan 03 Aug 2009 11:47:07
pareto Matthew Roughan 03 Aug 2009 11:47:07
random number generator Matthew Roughan 03 Aug 2009 11:47:07
distribution Matthew Roughan 03 Aug 2009 11:47:07
heavy tail Matthew Roughan 03 Aug 2009 11:47:07
powerlaw Matthew Roughan 03 Aug 2009 11:47:07

Contact us at files@mathworks.com