%% Create Diffuse Prior Model
% Consider the multiple linear regression model that predicts U.S. real gross national product (GNPR) using a linear combination of industrial production index (IPI), total employment (E), and real wages (WR).
% \texttt{GNPR}_t=\beta_0+\beta_1\texttt{IPI}_t+\beta_2\texttt{E}_t+\beta_3\texttt{WR}_t+\varepsilon_t.
% For all t time points, \varepsilon_t is a series of independent Gaussian disturbances with a mean of 0 and variance \sigma^2.
% Suppose that the regression coefficients \beta=[\beta_0,...,\beta_3]^\prime and the disturbance variance \sigma^2 are random variables, and you have no prior knowledge of their values or distribution. That is, you want to use the noninformative Jeffreys prior: the joint prior distribution is proportional to 1/{\sigma ^2}.
% These assumptions and the data likelihood imply an analytically tractable posterior distribution.
% Create a diffuse prior model for the linear regression parameters, which is the default prior model type. Specify the number of predictors p.

p = 3;
Mdl = bayeslm(p)

% Mdl is a diffuseblm Bayesian linear regression model object representing the prior distribution of the regression coefficients and disturbance variance. At the command window, bayeslm displays a summary of the prior distributions. Because the prior is noninformative and the data have not been incorporated yet, the summary is trivial.
%
% You can set writable property values of created models using dot notation. Set the regression coefficient names to the corresponding variable names.

Mdl.VarNames = ["IPI" "E" "WR"]

% Copyright 2012 The MathWorks, Inc.