LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
fj_xmax_pareto.m
1%{ @file fj_xmax_pareto.m
2 % @brief Expected maximum for Pareto distribution
3 %
4 % @author LINE Development Team
5%}
6
7%{
8 % @brief Expected maximum for Pareto distribution
9 %
10 % @details
11 % Computes the expected value of the maximum of K i.i.d. Pareto random
12 % variables using order statistics formulas.
13 %
14 % Pareto distribution CDF:
15 % F(x) = 1 - α(x + γ)^{-β}, x >= 0, β > 2
16 %
17 % For the standardized Pareto with mean 1:
18 % α = γ^β, γ = β - 1
19 % Mean = 1, Second moment M = 2 + 2/(β - 2)
20 %
21 % The j-th moment of the i-th order statistic is:
22 % m_{i,j} = Γ(K+1) * Γ(K - j + 1 - i/α) / [Γ(K + 1 - i/α) * Γ(K - j + 1)] * k^i
23 %
24 % For the maximum (i = K), the expected value can be computed numerically
25 % or approximated using the characteristic maximum method.
26 %
27 % @par Syntax:
28 % @code
29 % Xmax = fj_xmax_pareto(K, beta) % Standard Pareto (mean=1)
30 % Xmax = fj_xmax_pareto(K, beta, k) % Pareto with scale k
31 % [Xmax, MK] = fj_xmax_pareto(K, beta, k) % Also return characteristic max
32 % @endcode
33 %
34 % @par Parameters:
35 % <table>
36 % <tr><th>Name<th>Description
37 % <tr><td>K<td>Number of random variables (positive integer)
38 % <tr><td>beta<td>Shape parameter (beta > 2 required for finite moments)
39 % <tr><td>k<td>Optional: scale parameter (default: beta - 1 for mean = 1)
40 % </table>
41 %
42 % @par Returns:
43 % <table>
44 % <tr><th>Name<th>Description
45 % <tr><td>Xmax<td>Expected maximum E[Y_K]
46 % <tr><td>MK<td>Characteristic maximum M_K
47 % </table>
48 %
49 % @par Reference:
50 % A. Thomasian, "Analysis of Fork/Join and Related Queueing Systems",
51 % ACM Computing Surveys, Vol. 47, No. 2, Article 17, July 2014.
52 % Page 17:24 and 17:26.
53 %
54 % N.L. Johnson, S. Kotz, N. Balakrishnan, "Continuous Univariate
55 % Distributions", Vol. 1, Wiley, 1995.
56%}
57function [Xmax, MK] = fj_xmax_pareto(K, beta, k)
58
59if K < 1
60 line_error(mfilename, 'K must be a positive integer. Got K=%d.', K);
61end
62
63if beta <= 2
64 line_error(mfilename, 'Shape parameter beta must be > 2 for finite moments. Got beta=%.4f.', beta);
65end
66
67% Default scale parameter for mean = 1
68if nargin < 3 || isempty(k)
69 k = beta - 1;
70end
71
72if k <= 0
73 line_error(mfilename, 'Scale parameter k must be positive.');
74end
75
76% Pareto survival function: S(x) = (k / (k + x))^beta for x >= 0
77S_pareto = @(x) (k ./ (k + max(x, 0))).^beta;
78
79% Find m_K such that S(m_K) = 1/K
80% (k / (k + m_K))^beta = 1/K
81% k + m_K = k * K^(1/beta)
82% m_K = k * (K^(1/beta) - 1)
83mK = k * (K^(1/beta) - 1);
84
85% Compute expected maximum using numerical integration
86% E[Y_K] = integral_0^inf [1 - F(x)^K] dx = integral_0^inf [1 - (1-S(x))^K] dx
87% This can be split into:
88% E[Y_K] = integral_0^inf P(max > x) dx = integral_0^inf [1 - (1-S(x))^K] dx
89
90% For Pareto, we can use the order statistic formula
91% E[Y_(K)] for the K-th order statistic (maximum)
92Xmax = compute_pareto_max_expectation(K, beta, k);
93
94% Characteristic maximum
95if nargout > 1
96 % M_K = m_K + K * integral_{m_K}^{inf} S(x) dx
97 % For Pareto: integral_{m_K}^{inf} (k/(k+x))^beta dx
98 % = k^beta * integral_{m_K}^{inf} (k+x)^{-beta} dx
99 % = k^beta * [(k+x)^{1-beta} / (1-beta)]_{m_K}^{inf}
100 % = k^beta * (k+m_K)^{1-beta} / (beta-1)
101
102 if beta > 1
103 tail_integral = k^beta * (k + mK)^(1 - beta) / (beta - 1);
104 MK = mK + K * tail_integral;
105 else
106 % For beta <= 1, the integral diverges
107 MK = Inf;
108 end
109end
110
111end
112
113function Xmax = compute_pareto_max_expectation(K, beta, k)
114% Compute E[max(X_1, ..., X_K)] for Pareto distribution
115% Using numerical integration: E[Y_K] = integral_0^inf [1 - F(x)^K] dx
116
117% CDF: F(x) = 1 - (k/(k+x))^beta
118F_pareto = @(x) 1 - (k ./ (k + max(x, 0))).^beta;
119
120% Integrand: 1 - F(x)^K = 1 - [1 - (k/(k+x))^beta]^K
121integrand = @(x) 1 - F_pareto(x).^K;
122
123% Need to integrate from 0 to infinity
124% For numerical stability, split the integral and use appropriate bounds
125% The tail decays as (k/(k+x))^beta ~ k^beta / x^beta for large x
126
127% Find a reasonable upper limit where integrand is negligible
128upper_limit = k * K^(2/beta) * 10; % Conservative estimate
129
130Xmax = integral(integrand, 0, upper_limit, 'RelTol', 1e-8, 'AbsTol', 1e-10);
131end