%% Normal-Inverse-Wishart Semiconjugate Prior Model
% Consider the 3-D VAR(4) model in docid:econ_ug.mw_9054b8c2-0e9b-4703-9eed-8be7f867fb43. Assume these prior distributions:
% {\rm vec}(\Phi_1,...,\Phi_4,c)\vert\Sigma \sim N_{39}\left(\mu,V\right). \mu is a 39-by-1 vector of prior coefficient means (the model has 39 individual coefficients), and V is a 39-by-39 prior coefficient covariance matrix.
% \Sigma \sim {\rm Inverse\;Wishart}(\Omega,\nu). \Omega is the 3-by-3 scale matrix and \nu is the degrees of freedom of the inverse Wishart distribution.
% Create a normal-inverse-gamma semiconjugate prior model for the VAR model parameters.

numseries = 3;
numlags = 4;
PriorMdl = bayesvarm(numseries,numlags,'ModelType','semiconjugate')

% Mdl is a semiconjugatebvarm Bayesian VAR model object representing the prior distribution of the coefficients and innovations covariance matrix. bayesvarm displays a summary of the prior distributions at the command line. bayesvarm:
% Sets prior properties Mu, V, Omega, and DoF from defaults of optional inputs. You may set their values by using the appropriate name-value pair arguments or by using dot notation after you create PriorMdl.
% Derives the read-only properties AR, Constant, Trend, Beta, and Covariance from the values of the other properties.  You cannot set them directly.
% Copyright 2019 The MathWorks, Inc.
%