LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
aoi_lst_ph.m
1function lst = aoi_lst_ph(alpha, T)
2%AOI_LST_PH Laplace-Stieltjes transform for phase-type distribution
3%
4% lst = aoi_lst_ph(alpha, T)
5%
6% Returns a function handle for the LST of a phase-type (PH) distribution
7% with initial probability vector alpha and sub-generator matrix T.
8%
9% Parameters:
10% alpha (row vector): Initial probability vector (1 x n)
11% T (matrix): Sub-generator matrix (n x n)
12%
13% Returns:
14% lst (function_handle): LST function @(s) alpha * inv(s*I - T) * (-T*e)
15%
16% The LST of PH(alpha, T) is: H*(s) = alpha * (s*I - T)^{-1} * t
17% where t = -T * ones(n,1) is the exit rate vector.
18%
19% For numerical stability, we use: H*(s) = alpha * ((s*I - T) \ t)
20%
21% See also: aoi_lst_exp, aoi_lst_erlang, aoi_lst_det
22
23% Copyright (c) 2012-2026, Imperial College London
24% All rights reserved.
25
26% Validate inputs
27alpha = alpha(:)'; % Ensure row vector
28n = length(alpha);
29
30if size(T, 1) ~= n || size(T, 2) ~= n
31 line_error(mfilename, 'T must be %d x %d to match alpha', n, n);
32end
33
34% Exit rate vector
35t = -T * ones(n, 1);
36
37% Identity matrix
38I = eye(n);
39
40% Return function handle
41lst = @(s) ph_lst_eval(s, alpha, T, t, I);
42
43end
44
45function val = ph_lst_eval(s, alpha, T, t, I)
46%PH_LST_EVAL Evaluate PH LST at point(s) s
47
48 if isscalar(s)
49 val = alpha * ((s * I - T) \ t);
50 else
51 % Handle array input
52 val = zeros(size(s));
53 for i = 1:numel(s)
54 val(i) = alpha * ((s(i) * I - T) \ t);
55 end
56 end
57end