# DsgeVarLikelihood of Dynare 4.0.0 vs. Inestable Version

**URL:** <https://forum.dynare.org/t/dsgevarlikelihood-of-dynare-4-0-0-vs-inestable-version/6208>\
**Category:** Dynare help (legacy posts)\
**Created:** [13 May 2017 18:18 UTC](https://forum.dynare.org/t/dsgevarlikelihood-of-dynare-4-0-0-vs-inestable-version/6208 "2017-05-13T18:18:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aldo](https://forum.dynare.org/user_avatar/forum.dynare.org/aldo/32/5490_2.png) [@Aldo](https://forum.dynare.org/u/Aldo)\
**Post date:** [13 May 2017 18:18 UTC](https://forum.dynare.org/t/dsgevarlikelihood-of-dynare-4-0-0-vs-inestable-version/6208/1 "2017-05-13T18:18:50Z")

</div>

I am using codes written by Tim Robinson to compute forecast error (RMSE), in Dynare 4.0.0, especifically the DsgeVarLikelihood function:

[fval, cost\_flag, info, PHI\_STACKED, SIGMA, iXX] = DsgeVarLikelihood(xparam1, gend)

where:

xparam1 : value of vector of estimated parameters  
gend : Number of observations in the sample

I would like to use the unstable version of Dynare because it is faster than Dynare 4.0.0, but in this last I get this error:

Error using dsge\_var\_likelihood (line 80)  
Not enough input arguments.

Could you please help me to use the dsge\_var\_likelihood function and define inputs in the inestable version?

Also, I have another question, when I invoke options\_.nobs in inestable version I get a different value of the 4.0.0 version.

Thanks in advance

Aldo

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [14 May 2017 10:39 UTC](https://forum.dynare.org/t/dsgevarlikelihood-of-dynare-4-0-0-vs-inestable-version/6208/2 "2017-05-14T10:39:23Z")

</div>

In the unstable version, the syntax is

```auto

```

where most of the inputs come from the call to

`[dataset_, dataset_info, xparam1, hh, M_, options_, oo_, estim_params_, bayestopt_, bounds] = ...
    dynare_estimation_init(var_list_, dname, ], M_, options_, oo_, estim_params_, bayestopt_);`

Regarding your second question: what exactly do you mean? I would need more details

---

<div class="post-metadata">

**Author:** ![Aldo](https://forum.dynare.org/user_avatar/forum.dynare.org/aldo/32/5490_2.png) [@Aldo](https://forum.dynare.org/u/Aldo)\
**Post date:** [15 May 2017 02:59 UTC](https://forum.dynare.org/t/dsgevarlikelihood-of-dynare-4-0-0-vs-inestable-version/6208/3 "2017-05-15T02:59:54Z")

</div>

Thanks jpfeifer,

1. About the last question, I mean when I run my .mod I get options\_.nobs = 32 in unstable version, which is size of my data,  
but in 4.4.3 and previous versions I get options\_.nobs = 28.

2. By other side, when I try to use dsge\_var\_likelihood function running this:

[code] dynare mymod

options\_.first\_obs = 5;  
options\_.nobs = NaN;  
[dataset\_, dataset\_info, xparam1, hh, M\_, options\_, oo\_, estim\_params\_, bayestopt\_, bounds] = …  
dynare\_estimation\_init(var\_list\_, ], ], M\_, options\_, oo\_, estim\_params\_, bayestopt\_);

[fval,info,exit\_flag,grad,hess,SteadyState,trend\_coeff,PHI\_tilde,SIGMA\_u\_tilde,iXX,prior] = …  
dsge\_var\_likelihood(xparam1,dataset\_,dataset\_info,options\_,M\_,estim\_params\_,bayestopt\_,bounds,oo\_);[/code]

I get size(PHI\_tilde,1) = 20. But It should be 10 (=5x2) because I have five observable variables and I set

`options_.varlag = 2;
`

1. What would be the rigth form to loop over `dsge_prior_weight` option and over sample size to get PHI\_tilde and SIGMA\_u\_tilde. I loop over dsge\_prior\_weight in a .mod and I loop over sample size in a .m file. But I see when I loop in a .mod (over dsge\_prior\_weight) dynare estimates twice, it makes slow this method, because in each iteration I run my .mod and after I run dynare\_estimation(var\_list\_). I attach my files.  
[question.rar](https://forum.dynare.org/uploads/default/original/2X/5/500839c80b28d4431052bdf08275da7ec624c877.rar) (17.4 KB)

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [17 May 2017 11:43 UTC](https://forum.dynare.org/t/dsgevarlikelihood-of-dynare-4-0-0-vs-inestable-version/6208/4 "2017-05-17T11:43:04Z")

</div>

1- That is a matter of the changed internal treatment. In 4.4.3 nobs deducted the options\_.first\_obs. But that should not affect the results.  
2. You are setting the wrong option for the lag number. It should be

```auto

```

Thus, you are still at the default of 4.  
3. You should be able to change the prior weight within a loop via

```auto

```
