![]() |
Previous | Next | persist_g.m |
global persist_g_info
[gk] = persist_g(k, xk1)
[gk, Gk] = persist_g(k, xk1)
initial = persist_g.initial
n = size(xk1, 1)
k
given the state at time
index
k-1
is its value at time index
k-1
.
(This corresponds to a random walk model.)
n
specifying the initial estimate
for the state vector at time index one.
k-1
.
k == 1
,
the return value
gk
is equal to
initial
.
Otherwise,
gk
is equal to
xk1
.
Gk
is an
n x n
matrix equal to the
Jacobian of
gk
w.r.t
xk1
; i.e., the identity matrix.
function [gk, Gk] = persist_g(k, xk1)
global persist_g_info
initial = persist_g_info.initial;
n = size(xk1, 1);
if k == 1
gk = initial;
Gk = zeros(n, n);
else
gk = xk1;
Gk = eye(n);
end
return
end