LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
infer_lqn_jacobian.m
1function [H, h0] = infer_lqn_jacobian(hfun, a, fdStep, fdFloor)
2% INFER_LQN_JACOBIAN Forward finite-difference sensitivity matrix of h at a.
3%
4% [H, H0] = INFER_LQN_JACOBIAN(HFUN, A, FDSTEP, FDFLOOR) returns the
5% sensitivity matrix H = dh/da evaluated at the parameter vector A by forward
6% finite differences, and H0 = HFUN(A). HFUN maps a parameter vector to a
7% numeric observation vector z = h(a). This is the approximate sensitivity
8% matrix H_k used in the EKF update (Zheng, Yang, Woodside, Litoiu, Iszlai,
9% "Tracking Time-Varying Parameters in Software Systems with Extended Kalman
10% Filters", CASCON 2005).
11%
12% Each column is H(:,i) = (HFUN(a + d_i) - H0)/d_i with the per-parameter
13% step d_i = FDSTEP * max(|a_i|, FDFLOOR). HFUN is evaluated numel(A)+1 times.
14%
15% FDSTEP : relative perturbation (default 1e-3)
16% FDFLOOR : minimum absolute perturbation scale (default 1e-6)
17%
18% Copyright (c) 2012-2026, Imperial College London
19% All rights reserved.
20
21if nargin < 3 || isempty(fdStep), fdStep = 1e-3; end
22if nargin < 4 || isempty(fdFloor), fdFloor = 1e-6; end
23
24a = a(:);
25np = numel(a);
26h0 = hfun(a);
27h0 = h0(:);
28no = numel(h0);
29
30H = zeros(no, np);
31for i = 1:np
32 d = fdStep * max(abs(a(i)), fdFloor);
33 ap = a;
34 ap(i) = ap(i) + d;
35 hi = hfun(ap);
36 H(:, i) = (hi(:) - h0) / d;
37end
38end
Definition Station.m:245