Home > matlab > GetOneDraw.m

GetOneDraw

PURPOSE ^

function [xparams, logpost] = GetOneDraw(type)

SYNOPSIS ^

function [xparams, logpost] = GetOneDraw(type)

DESCRIPTION ^

 function [xparams, logpost] = GetOneDraw(type)
 draws one row from metropolis

 INPUTS
    type:      posterior
               prior
        
 OUTPUTS
    xparams:   vector of estimated parameters (drawn from posterior distribution)
    logpost:   log of the posterior density relative to this row
        
 SPECIAL REQUIREMENTS
    none

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [xparams, logpost] = GetOneDraw(type)
0002 
0003 % function [xparams, logpost] = GetOneDraw(type)
0004 % draws one row from metropolis
0005 %
0006 % INPUTS
0007 %    type:      posterior
0008 %               prior
0009 %
0010 % OUTPUTS
0011 %    xparams:   vector of estimated parameters (drawn from posterior distribution)
0012 %    logpost:   log of the posterior density relative to this row
0013 %
0014 % SPECIAL REQUIREMENTS
0015 %    none
0016 
0017 % Copyright (C) 2005-2009 Dynare Team
0018 %
0019 % This file is part of Dynare.
0020 %
0021 % Dynare is free software: you can redistribute it and/or modify
0022 % it under the terms of the GNU General Public License as published by
0023 % the Free Software Foundation, either version 3 of the License, or
0024 % (at your option) any later version.
0025 %
0026 % Dynare is distributed in the hope that it will be useful,
0027 % but WITHOUT ANY WARRANTY; without even the implied warranty of
0028 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0029 % GNU General Public License for more details.
0030 %
0031 % You should have received a copy of the GNU General Public License
0032 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
0033 
0034 switch type
0035   case 'posterior'
0036     [xparams, logpost] = metropolis_draw(0);
0037   case 'prior'
0038     xparams = prior_draw(0);
0039     logpost = evaluate_posterior_kernel(xparams');
0040 end

Generated on Mon 21-May-2012 02:42:43 by m2html © 2005