LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
getSensitivityRanking.m
1function RankTable = getSensitivityRanking(self, params, reward)
2% RANKTABLE = GETSENSITIVITYRANKING(PARAMS, REWARD)
3%
4% Rank model parameters by their influence on a steady-state reward, as in
5% Trivedi and Bobbio (2017), Table 9.3.
6%
7% Both the unscaled sensitivity of Eq. (9.79) and the scaled sensitivity of
8% Eq. (9.80) are reported. The ranking is by descending absolute scaled
9% sensitivity, since that is the comparison the book makes: the scaled form
10% is dimensionless, so it is the one that can be compared across parameters
11% measured in different units. The sign is retained in the table because it
12% says whether increasing a parameter helps or hurts.
13%
14% @param params Cell array of parameter structs, see SolverCTMC.getSensitivity
15% @param reward Reward rate vector or handle over the state space
16% @return RankTable Table with columns Parameter, Value, Sens, ScaledSens, sorted
17%
18% Copyright (c) 2012-2026, Imperial College London
19% All rights reserved.
20
21if ~iscell(params)
22 line_error(mfilename, 'params must be a cell array of parameter structs');
23end
24if nargin < 3 || isempty(reward)
25 line_error(mfilename, 'a reward is required to rank parameters');
26end
27
28L = length(params);
29Parameter = cell(L, 1);
30Value = zeros(L, 1);
31Sens = zeros(L, 1);
32ScaledSens = zeros(L, 1);
33
34for l = 1:L
35 p = params{l};
36 if isfield(p, 'name') && ~isempty(p.name)
37 Parameter{l} = p.name;
38 else
39 Parameter{l} = sprintf('theta%d', l);
40 end
41 [S, SS] = self.getSensitivity(p, reward);
42 Value(l) = p.value;
43 Sens(l) = S;
44 ScaledSens(l) = SS;
45end
46
47[~, ord] = sort(abs(ScaledSens), 'descend');
48Parameter = categorical(Parameter(ord));
49Value = Value(ord);
50Sens = Sens(ord);
51ScaledSens = ScaledSens(ord);
52
53RankTable = table(Parameter, Value, Sens, ScaledSens);
54end
Definition Station.m:245