Previous Next persist_g.m

ckbs_nonlinear: Example of Persistence Transition Function

Syntax
global persist_g_info
[gk    = persist_g(kxk1)
[gkGk] = persist_g(kxk1)

Notation

   
initial = persist_g.initial
     
n       = size(xk1, 1)

Purpose
Implements the persistence model for state transitions; i.e., the mean of the state at time index k given the state at time index k-1 is its value at time index k-1 . (This corresponds to a random walk model.)

initial
is a column vector of length n specifying the initial estimate for the state vector at time index one.

k
is a positive integer scalar specifies the current time index.

xk1
is a column vector specifying a value for the state vector at the previous time index k-1 .

gk
If k == 1 , the return value gk is equal to initial . Otherwise, gk is equal to xk1 .

Gk
The return value Gk is an n x n matrix equal to the Jacobian of gk w.r.t xk1 ; i.e., the identity matrix.

Source Code
 
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

Input File: example/nonlinear/persist_g.m