%% Create Normal-Inverse-Wishart Semiconjugate Prior Model
% Consider the 3-D VAR(4) model for the US inflation (INFL), unemployment (UNRATE), and federal funds (FEDFUNDS) rates.
% \left[ {\begin{array}{*{20}{l}}
% {\texttt{INFL}_t}\\
% {\texttt{UNRATE}_t}\\
% {\texttt{FEDFUNDS}_t}
% \end{array}} \right] = c + \sum\limits_{j = 1}^4 {{\Phi _j}\left[ {\begin{array}{*{20}{l}}
% {\texttt{INFL}_{t-j}\\
% {\texttt{UNRATE}_{t-j}\\
% {\texttt{FEDFUNDS}_{t-j}
% \end{array}} \right]} + \left[ {\begin{array}{*{20}{c}}
% {{\varepsilon _{1,t}}}\\
% {{\varepsilon _{2,t}}}\\
% {{\varepsilon _{3,t}}}
% \end{array}} \right].
% For all t, \varepsilon_t is a series of independent 3-D normal innovations with a mean of 0 and covariance \Sigma. Assume the following prior distributions:
% \textrm{vec}\left({\left\lbrack \Phi_1 ,\ldotp \ldotp \ldotp ,\Phi_4 ,c\right\rbrack }^{\prime } \right)\left|\Sigma \sim N_{39} \left(\mu ,V\right)\right., where \mu is a 39-by-1 vector of means and V is the 39-by-39 covariance matrix.
% \Sigma\sim{\rm Inverse\, Wishart}\left(\Omega,\nu\right), where \Omega is the 3-by-3 scale matrix and \nu is the degrees of freedom.
% Create a semiconjugate prior model for the 3-D VAR(4) model parameters.

numseries = 3;
numlags = 4;
PriorMdl = semiconjugatebvarm(numseries,numlags)

% PriorMdl is a semiconjugatebvarm Bayesian VAR model object representing the prior distribution of the coefficients and innovations covariance of the 3-D VAR(4) model. The command line display shows properties of the model.  You can display properties by using dot notation.
% Display the prior mean matrices of the four AR coefficients by setting each matrix in the cell to a variable.

AR1 = PriorMdl.AR{1}
AR2 = PriorMdl.AR{2}
AR3 = PriorMdl.AR{3}
AR4 = PriorMdl.AR{4}

% semiconjugatebvarm centers all AR coefficients at 0 by default. The AR property is read-only, but it is derived from the writeable property Mu.
% Copyright 2020 The MathWorks, Inc.
%