www.gusucode.com > econ 案例源码程序 matlab代码 > econ/diffuseRegressionParamMap.m

    
% Copyright 2015 The MathWorks, Inc.

function [A,B,C,D,Mean0,Cov0,StateType,DeflateY] = diffuseRegressionParamMap(params,y,z)
% Diffuse state-space model with a regression component parameter mapping
% function example. This function maps the vector params to the state-space
% matrices (A, B, C, and D) and indicates the type of states (StateType).
% The state model contains an ARMA(1,1) model and a random walk.
    varu1 = exp(params(3)); % Positive variance constraint
    vare1 = exp(params(5));
    A = [params(1) params(2); 0 0];
    B = [sqrt(varu1) 0; 1 0]; 
    C = [varu1 0];
    D = sqrt(vare1);
    Mean0 = []; % Let software infer Mean0
    Cov0 = [];  % Let software infer Cov0
    StateType = [0 0 2];
    DeflateY = y - params(6)*z;
end