# DSGE\_VAR prior weight equals inf not allowed? bugs?

**URL:** <https://forum.dynare.org/t/dsge-var-prior-weight-equals-inf-not-allowed-bugs/1789>\
**Category:** DSGE-VAR\
**Created:** [23 December 2010 22:25 UTC](https://forum.dynare.org/t/dsge-var-prior-weight-equals-inf-not-allowed-bugs/1789 "2010-12-23T22:25:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jiangmin](https://forum.dynare.org/letter_avatar_proxy/v4/letter/j/a183cd/32.png) [@jiangmin](https://forum.dynare.org/u/jiangmin)\
**Post date:** [23 December 2010 22:25 UTC](https://forum.dynare.org/t/dsge-var-prior-weight-equals-inf-not-allowed-bugs/1789/1 "2010-12-23T22:25:25Z")

</div>

Hi,

When I estimate a model using the DSGE\_VAR framework, and set the parameter dsge\_prior\_weight to inf, all the estimation procedure works fine, but this error message comes up when computing the bayesian\_irf:

??? Error using ==\> randn  
NaN and Inf not allowed.

Error in ==\> rand\_inverse\_wishart at 44  
X = randn(v, m) \* H\_inv\_upper\_chol;

Error in ==\> PosteriorIRF\_core1 at 186  
SIGMAu\_draw = rand\_inverse\_wishart(nvobs,  
DSGE\_PRIOR\_WEIGHT-NumberOfParametersPerEquation, …

Error in ==\> PosteriorIRF at 199  
[fout] = PosteriorIRF\_core1(localVars,1,B,0);

Error in ==\> dynare\_estimation\_1 at 1120  
PosteriorIRF(‘posterior’);

Error in ==\> dynare\_estimation at 62  
dynare\_estimation\_1(var\_list,varargin{:});

Based on the dsge\_var entry of the dynare wiki, it seems to me that setting dsge\_prior\_weight to infinity (as Del Negro and Schorfheide have done in various papers) in dynare is allowed. But the error seems to suggest that inf blows up the dimension of matrix in the irf draws…Is this a bug that needs to be fixed? (otherwise I have to set the weight to a large number, say 10000, to ‘approximate’ infinity?)

Thank you very much!!

---

<div class="post-metadata">

**Author:** ![angeloeco](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/7993a0/32.png) [@angeloeco](https://forum.dynare.org/u/angeloeco)\
**Post date:** [29 November 2019 15:31 UTC](https://forum.dynare.org/t/dsge-var-prior-weight-equals-inf-not-allowed-bugs/1789/2 "2019-11-29T15:31:57Z")

</div>

Did you get run it?

could you post the lambda prior?

i put  
dsge\_prior\_weight, uniform\_pdf,inf,2;  
but the code doesnt run!

Someone can help me?

---

<div class="post-metadata">

**Author:** ![angeloeco](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/7993a0/32.png) [@angeloeco](https://forum.dynare.org/u/angeloeco)\
**Post date:** [29 November 2019 18:04 UTC](https://forum.dynare.org/t/dsge-var-prior-weight-equals-inf-not-allowed-bugs/1789/3 "2019-11-29T18:04:42Z")

</div>

@stepan-a @jpfeifer could you help me?

i cant get run my code with:

dsge\_prior\_weight, uniform\_pdf,inf,2;

i’d like to elicit a prior mean infinity to dsge\_prior\_weight.

best reguards

---

<div class="post-metadata">

**Author:** ![stepan-a](https://forum.dynare.org/user_avatar/forum.dynare.org/stepan-a/32/6652_2.png) [@stepan-a](https://forum.dynare.org/u/stepan-a)\
**Post date:** [29 November 2019 21:38 UTC](https://forum.dynare.org/t/dsge-var-prior-weight-equals-inf-not-allowed-bugs/1789/4 "2019-11-29T21:38:40Z")

</div>

Hi,

You should read the reference manual, the prior you define here makes no sense: a uniform distribution cannot have an infinite expectation (first argument after the declaration of the prior shape).

Best,  
Stéphane.

---

<div class="post-metadata">

**Author:** ![angeloeco](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/7993a0/32.png) [@angeloeco](https://forum.dynare.org/u/angeloeco)\
**Post date:** [29 November 2019 21:42 UTC](https://forum.dynare.org/t/dsge-var-prior-weight-equals-inf-not-allowed-bugs/1789/5 "2019-11-29T21:42:37Z")

</div>

i read the reference manual. how do you would elicit this prior? what distribution i should use?

dsge\_prior\_weight, ?\_pdf,inf,2;

---

<div class="post-metadata">

**Author:** ![stepan-a](https://forum.dynare.org/user_avatar/forum.dynare.org/stepan-a/32/6652_2.png) [@stepan-a](https://forum.dynare.org/u/stepan-a)\
**Post date:** [29 November 2019 21:57 UTC](https://forum.dynare.org/t/dsge-var-prior-weight-equals-inf-not-allowed-bugs/1789/6 "2019-11-29T21:57:12Z")

</div>

Dynare does not provide priors centered on infinity. If you want to estimate a DSGE-VAR model with \lambda=\infty you have to calibrate the parameter.

Best,  
Stéphane.

---

<div class="post-metadata">

**Author:** ![angeloeco](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/7993a0/32.png) [@angeloeco](https://forum.dynare.org/u/angeloeco)\
**Post date:** [29 November 2019 21:58 UTC](https://forum.dynare.org/t/dsge-var-prior-weight-equals-inf-not-allowed-bugs/1789/7 "2019-11-29T21:58:44Z")

</div>

okay. i will do it.  
thanks
