#acl DynareWriterGroup:read,write,delete,revert DynareTeamGroup:read,write,delete,revert,admin All:read = Reversible Jump MCMC routines in Dynare = * '''__Functions__''' * '''__Structures__''' * '''__Notes on the algorithm__'''[[attachment:rjmcmc]] == Introduction == Bayesian model selection is performed on the basis of the posterior model probabilities <> which can be evaluate in this case by considering the models parameters as unknown and updating at each iteration of the MCMC knowing the model index k. To be more precise, the dimensionality of the parameter space represents an unknown parameter. Let <> be the parameters vector associated with the model of order k. There's three kind of possible move which can be described. In steps 1 and 2, we go from a model k to an other one of different length k' with the probability <>. The dimension matching requirement (Green, 1995) set dim(k)+dim(q(u))=dim(k')+dim(q(u')) where the function q(.) is the proposal and u an additional random vector. In the literature, we call a "birth move" the fact that dim(k')>dim(k), otherwise this is a "death move". In the last step, we stay within a same model. In that case, a standard MH can be run. == Algorithm == I. choose initial values II. for i=1,N {{{#!latex $J(k'|k)\propto exp(\lambda)$ }}} i. Birth move: if <dim(\theta^{(k)})$)>> go from k to k'=k+n by drawing n values from a random vector u of length n {{{#!latex \begin{eqnarray*} \theta^{(k')}_u \sim p(\theta^{(k')}_u|k') \\ \theta^{(k')}= \left ( \begin{array}{c} \theta^{(k)} \\ \theta^{(k')}_u \\ \end{array} \right ) \end{eqnarray*} }}} if <> k=k' end if ii. Death move: else if <> deterministic step to go from k to k'=k-n <> if <> k=k' end if iii. else <> end if end The proposal distribution for changes in model order has the following expression: {{{#!latex $J(k'|k)\propto exp(\lambda)\frac{\lambda}{k!}$ }}} or {{{#!latex $$ J(k'|k)\propto \left\{ \begin{array}{l} exp(-\lambda)|k'-k| \quad\textrm{ if } k'\not=k \\ 0 \quad\textrm{ otherwise } \end{array} \right. $$ }}} The symmetry of the distribution leads the ratio of model prior densities to be 1 == Acceptation Probabilities == we assume here that the proposal distribution is the parameters prior density. Consider {{{#!latex $$ \theta^{'(i)}\sim (\theta_i|\theta_{-i},k,y) \propto \begin{cases} p(\theta^{(k')}|y,k',\theta^{(k)}) \mbox{, if } i=k' \\ \\ p(\theta^{(i)}) \mbox{, if } i\neq k' \end{cases} $$ }}} where the proposal distribution is <> and <> is called "pseudo-prior". Under the assumption of a symmetric random-walk proposal distribution, we can derive the acceptance ratio. {{{#!latex \begin{eqnarray*} \alpha\left((k,\theta^{(k)}\to (k',\theta^{(k')})\right)= min\left(1,\underbrace{\frac{p(k',\theta^{(k')}|y,\sigma_e)}{p(k,\theta^{(k)}|y,\sigma_e)}}_{target proba} \underbrace{\frac{J(k|k')}{J(k'|k)}}_{model prior} \underbrace{\frac{q(\theta^{(k')}|k')}{q(\theta^{(k)}|k)}}_{proposal ratio} \right) \end{eqnarray*} }}} The Jacobian cancel since the transformation let unchanged the scale of parameters vectors. {{{#!latex \begin{eqnarray*} \alpha\left((k,\theta^{(k)}\to (k',\theta^{(k')})\right)= min\left(1, \frac{p(y|k',\theta^{(k')},\sigma_e)}{p(y|k,\theta^{(k)},\sigma_e)} \frac{p(k')}{p(k)} \frac{p(\theta^{(k')}|k')}{p(\theta^{(k)}|k)} \frac{q(\theta^{(k')}|k')}{q(\theta^{(k)}|k)} \right) \end{eqnarray*} }}} using the definition of joint posterior distribution: {{{#!latex \begin{eqnarray*} p(k,\theta^{(k)},\sigma_e|y)\propto \underbrace{p(y|k,\theta^{(k)},\sigma_e)}_{Likelihood} \underbrace{p(k)p(\theta^{(k)}|k)p(\sigma_e)}_{priors} \end{eqnarray*} }}} Precisely the full posterior distribution for the composite model space can be expressed as {{{#!latex \begin{eqnarray*} p(k,\theta|y)\propto p(y|k,\theta)p(\theta_k|k)p(\theta_{-k}|\theta_k,k)p(k) \end{eqnarray*} }}} It depends only upon the corresponding parameters <>, for a particular k. <> represents all parameters not used by model k. Hence, <> is this "pseudo-prior" which is not used by k. Assuming p(k) follows a uniform distribution, the ratio <> and the common parameters prior in the ratio prior densities cancel. If we consider the case where <> is iid gaussian, the priors for the common model terms cancel leaving for a birth move: {{{#!latex \begin{eqnarray*} \alpha\left((k,\theta^{(k)}\to (k',\theta^{(k')})\right)= min\left(1, \frac{p(y|k',\theta^{(k')},\sigma_e)}{p(y|k,\theta^{(k)},\sigma_e)} p_{\theta}(\theta_u^{(k')}|k') %\frac{p(\theta^{(k')}|\sigma_e)_\rho}{p(\theta^{(k)}|\sigma_e)\rho} \frac{q(\theta^{(k')}|k')}{q(\theta^{(k)}|k)} \right) \end{eqnarray*} }}} Knowing that <> and the fact that the reverse transformation is deterministic (ie <> is empty and <>. We have finally: {{{#!latex \begin{eqnarray*} \alpha ^{birth}\left((k,\theta^{(k)}\to (k',\theta^{(k')})\right)= min\left(1, \frac{p(y|k',\theta^{(k')},\sigma_e)}{p(y|k,\theta^{(k)},\sigma_e)} \right) \end{eqnarray*} }}} and {{{#!latex \begin{eqnarray*} \alpha ^{death}\left((k,\theta^{(k)}\to (k',\theta^{(k')})\right)= min\left(1, \frac{p(y|k,\theta^{(k)},\sigma_e)}{p(y|k',\theta^{(k')},\sigma_e)} \right) \end{eqnarray*} }}}