Merge pull request #1261 from JohannesPfeifer/bvar

BVAR: Save prior and posterior information in oo_
time-shift
MichelJuillard 2016-08-20 17:39:34 +02:00 committed by GitHub
commit 5c69c789f6
2 changed files with 3 additions and 1 deletions

View File

@ -499,7 +499,7 @@ The syntax for computing the marginal density is:
The options are those described above.
The command will actually compute the marginal density for several models: first for the model with one lag, then with two lags, and so on up to \textit{max\_number\_of\_lags} lags. Results will be stored in a \textit{max\_number\_of\_lags} by 1 vector \texttt{oo\_.bvar.log\_marginal\_data\_density}.
The command will actually compute the marginal density for several models: first for the model with one lag, then with two lags, and so on up to \textit{max\_number\_of\_lags} lags. Results will be stored in a \textit{max\_number\_of\_lags} by 1 vector \texttt{oo\_.bvar.log\_marginal\_data\_density}. The command will also store the prior and posterior information into \textit{max\_number\_of\_lags} by 1 cell arrays \texttt{oo\_.bvar.prior} and \texttt{oo\_.bvar.posterior}.
\subsection{Forecasting}

View File

@ -35,6 +35,8 @@ oo_.bvar.log_marginal_data_density=NaN(maxnlags,1);
for nlags = 1:maxnlags
[ny, nx, posterior, prior] = bvar_toolbox(nlags);
oo_.bvar.posterior{nlags}=posterior;
oo_.bvar.prior{nlags}=prior;
posterior_int = matrictint(posterior.S, posterior.df, posterior.XXi);
prior_int = matrictint(prior.S, prior.df, prior.XXi);