
% Copyright 2015 The MathWorks, Inc.

function [A,B,C,D,Mean0,Cov0,StateType,DeflateY] = regressionParamMap(params,y,z)
% 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), the initial state value and the initial state variance
% (Mean0 and Cov0), and the type of state (StateType). The state model is
% an ARMA(1,1).
    varu1 = exp(params(3)); % Positive variance constraint
    vare1 = exp(params(4));
    A = [params(1) params(2); 0 0];
    B = [sqrt(varu1); 1]; 
    C = [1 0];
    D = sqrt(vare1);
    Mean0 = [0.5 0.5];
    Cov0 = eye(2);
    StateType = [0 0];
    DeflateY = y - params(5)*z;
end
