Skip to content
Snippets Groups Projects
Commit 5a91b601 authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Merge pull request #1134 from JohannesPfeifer/bvar_mdd

Save marginal data density from BVAR in oo_
parents 2643bfaa 6b31363d
Branches
Tags
No related merge requests found
......@@ -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.
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}.
\subsection{Forecasting}
......
......@@ -29,6 +29,10 @@ function bvar_density(maxnlags)
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
global oo_
oo_.bvar.log_marginal_data_density=NaN(maxnlags,1);
for nlags = 1:maxnlags
[ny, nx, posterior, prior] = bvar_toolbox(nlags);
......@@ -39,6 +43,8 @@ for nlags = 1:maxnlags
log_dnsty = posterior_int - prior_int - 0.5*ny*lik_nobs*log(2*pi);
oo_.bvar.log_marginal_data_density(nlags)=log_dnsty;
skipline()
fprintf('The marginal log density of the BVAR(%g) model is equal to %10.4f\n', ...
nlags, log_dnsty);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment