diff --git a/doc/bvar-a-la-sims.tex b/doc/bvar-a-la-sims.tex index 593e17759ce0eb90e7952f4e634a764630c56aa4..2a3af7ea9100c35dae7c78fa3d2372ccc7cf508f 100644 --- a/doc/bvar-a-la-sims.tex +++ b/doc/bvar-a-la-sims.tex @@ -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} diff --git a/matlab/bvar_density.m b/matlab/bvar_density.m index ecde347c6b20e16ac195e5a8f3b3805a58b146eb..b147834ed6b37701508de8d416289ddeb53b1318 100644 --- a/matlab/bvar_density.m +++ b/matlab/bvar_density.m @@ -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);