1classdef Pareto < ContinuousDistribution
2 % The Pareto statistical distribution
4 % Copyright (c) 2012-2026, Imperial College London
8 function self = Pareto(shape, scale)
9 % SELF = PARETO(SHAPE, SCALE)
11 % Constructs a Pareto distribution with given shape and scale
13 self@ContinuousDistribution(
'Pareto',2,[0,Inf]);
15 line_error(mfilename,
'shape parameter must be >= 2.0');
17 setParam(self, 1,
'alpha', shape);
18 setParam(self, 2,
'k', scale);
21 function ex = getMean(self)
24 % Get distribution mean
25 shape = self.getParam(1).paramValue;
26 scale = self.getParam(2).paramValue;
27 ex = shape * scale / (shape - 1);
30 function SCV = getSCV(self)
33 % Get distribution squared coefficient of variation (SCV = variance / mean^2)
34 shape = self.getParam(1).paramValue;
35 scale = self.getParam(2).paramValue;
36 VAR = scale^2 * shape / (shape - 1)^2 / (shape - 2);
37 ex = shape * scale / (shape - 1);
41 function X = sample(self, n)
44 % Get n samples from the distribution
45 if nargin<2 %~exist(
'n',
'var'),
48 shape = self.getParam(1).paramValue;
49 scale = self.getParam(2).paramValue;
52 X = gprnd(k, sigma, sigma/k, n, 1);
55 function Ft = evalCDF(self,t)
56 % FT = EVALCDF(SELF,T)
58 % Evaluate the cumulative distribution function at t
61 shape = self.getParam(1).paramValue;
62 scale = self.getParam(2).paramValue;
65 Ft = gpcdf(t, k, sigma, sigma/k);
68 function L = evalLST(self, s)
70 % Evaluate the Laplace-Stieltjes transform of the distribution function at s
71 % The LST of Pareto distribution doesn
't have a simple closed form.
72 % We compute it numerically using the definition: E[e^(-sX)] = ∫_{k}^∞ e^(-sx) f(x) dx
73 % where f(x) is the Pareto PDF: α*k^α / x^(α+1) for x >= k
75 alpha = self.getParam(1).paramValue; % shape parameter
76 k = self.getParam(2).paramValue; % scale parameter
78 % Use numerical integration
79 % For practical purposes, we integrate up to a reasonable upper bound
80 upperBound = k * (1000)^(1/alpha); % covers most of the distribution
82 dx = (upperBound - k) / n;
88 % Pareto PDF: α*k^α / x^(α+1)
89 pdf = alpha * k^alpha / x^(alpha + 1);
90 L = L + exp(-s * x) * pdf;
96 % OLD IMPLEMENTATION (using integral function):
97 % Saralees Nadarajah & Samuel Kotz.
98 % On the Laplace transform of the Pareto distribution
99 % Queueing Syst (2006) 54:243-244
100 % DOI 10.1007/s11134-006-0299-1
103 % alpha = self.getParam(1).paramValue;
104 % k = self.getParam(2).paramValue;
105 % IL = integral(@(t)t.^(-alpha-1).*exp(-t),s*k,Inf);
106 % L(end+1) = alpha*k^alpha*IL*s^(1+alpha)/s;
107 % %a = shape; b = scale; L = integral(@(x) a*b^a*exp(-s*x)./(x).^(a+1),b,1e6);
111 function proc = getProcess(self)
112 % PROC = GETPROCESS()
114 % Get process representation with actual distribution parameters
115 % Returns {shape (alpha), scale (k)}
for Pareto distribution
116 proc = {self.getParam(1).paramValue, self.getParam(2).paramValue};
121 function pa = fitMeanAndSCV(MEAN, SCV)
122 % PA = FITMEANANDSCV(MEAN, SCV)
124 % Fit distribution with given mean and squared coefficient of variation (SCV=variance/mean^2)
125 % For Pareto distribution with shape alpha and scale k:
126 % Mean = alpha*k / (alpha-1)
127 % SCV = 1 / (alpha*(alpha-2))
129 % Solving
for alpha from SCV:
130 % alpha*(alpha-2) = 1/SCV
131 % alpha^2 - 2*alpha - 1/SCV = 0
132 % alpha = 1 + sqrt(1 + 1/SCV) (taking positive root, need alpha > 2)
134 % Then scale k from mean:
135 % k = MEAN * (alpha-1) / alpha
137 shape = 1 + sqrt(1 + 1/SCV);
138 scale = MEAN * (shape - 1) / shape;
139 pa = Pareto(shape, scale);