%% Display Diffuse State-Space Model with Initial Values
% Create a diffuse state-space model containing two independent, autoregressive states, and where the observations are the deterministic sum of the two states. Symbolically, the system of equations is
% \left[
% {\begin{array}{*{20}{c}}{{x_{t,1}}}\\{{x_{t,2}}}\end{array}} \right] =
% \left[ {\begin{array}{*{20}{c}}{{\phi _1}}&0\\0&{{\phi _2}}\end{array}}
% \right]\left[ {\begin{array}{*{20}{c}}{{x_{t - 1,1}}}\\{{x_{t -
% 1,2}}}\end{array}} \right] + \left[
% {\begin{array}{*{20}{c}}{\sigma_1} & 0\\0 & \sigma_2\end{array}} \right]\left[
% {\begin{array}{*{20}{c}}{{u_{t,1}}}\\{{u_{t,2}}}\end{array}}
% \right]
% {y_t} = \left[ {\begin{array}{*{20}{c}}1&1\end{array}}
% \right]\left[
% {\begin{array}{*{20}{c}}{{x_{t,1}}}\\{{x_{t,2}}}\end{array}}
% \right].
% Specify the state-transition matrix.

A = [NaN 0; 0 NaN];

%
% Specify the state-disturbance-loading matrix.

B = [NaN 0; 0 NaN];

%
% Specify the measurement-sensitivity matrix.

C = [1 1];

%
% Create the diffuse state-space model by using dssm. Specify that the first state is stationary and the second is diffuse.

StateType = [0; 2];
Mdl = dssm(A,B,C,'StateType',StateType);

% Mdl is a dssm model object.
%
% Display the state-space model. Specify initial values for the unknown parameters and the initial state means and covariance matrix as follows:
% \phi_{1,0} = \phi_{2,0} = 0.1.
% \sigma_{1,0} = \sigma_{2,0} = 0.2.

params = [0.1; 0.1; 0.2; 0.2];
disp(Mdl,params)

% The software computes the initial state mean and variance of the stationary state using its stationary distribution.
% Copyright 2015 The MathWorks, Inc.