# Reference to non-existent field nstatic

**URL:** <https://forum.dynare.org/t/reference-to-non-existent-field-nstatic/15304>\
**Category:** General DSGE Modeling\
**Created:** [4 March 2020 10:06 UTC](https://forum.dynare.org/t/reference-to-non-existent-field-nstatic/15304 "2020-03-04T10:06:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![adar](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/58f4c7/32.png) [@adar](https://forum.dynare.org/u/adar)\
**Post date:** [4 March 2020 10:06 UTC](https://forum.dynare.org/t/reference-to-non-existent-field-nstatic/15304/1 "2020-03-04T10:06:45Z")

</div>

Hello everyone,  
I try to replicate the estimation of Iacoviello & Guerreri (2017), "Collateral Constraints and Macroeconomic asymmetries’ using their codes available here:([https://www.matteoiacoviello.com/research.htm](https://www.matteoiacoviello.com/research.htm)).  
Unfortunately, I have the following error message :  
Reference to non-existent field ‘nstatic’.  
Error in get\_pq (line 5)  
statevar\_pos = (dr\_.nstatic +1):(nvars-dr\_.nfwrd);  
Error in solve\_two\_constraints\_firstcall (line 110)  
[decrulea,decruleb]=get\_pq(oo00\_.dr);

Error in call\_process\_mod\_files (line 61)  
solve\_two\_constraints\_firstcall(modnam\_00,modnam\_10,modnam\_01,modnam\_11);

Error in runsim\_estimation (line 178)  
call\_process\_mod\_files

I try with different versions of dynare and each time I have the same error.  
Has anyone had the same issue?

---

<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:** [4 March 2020 12:00 UTC](https://forum.dynare.org/t/reference-to-non-existent-field-nstatic/15304/2 "2020-03-04T12:00:51Z")

</div>

Please see

> [@OCCBIN in newer Dynare versions](https://forum.dynare.org/t/about-the-steady-state/15172/6):
>
> Please try the modified Occbin toolkit files [toolkit\_files\_4.5.zip](https://forum.dynare.org/uploads/short-url/5rZoZPx7Nt8QjsiYTrDxeylEvMy.zip) (20.1 KB)

which should work with Dynare 4.5

---

<div class="post-metadata">

**Author:** ![adar](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/58f4c7/32.png) [@adar](https://forum.dynare.org/u/adar)\
**Post date:** [4 March 2020 12:42 UTC](https://forum.dynare.org/t/reference-to-non-existent-field-nstatic/15304/3 "2020-03-04T12:42:50Z")

</div>

Sorry I haven’t seen this post! Thanks for your reply. However, I have now the following error message :

Not enough input arguments.  
Error in get\_pq (line 5)\*  
statevar\_pos = (M\_.nstatic +1):(nvars-M\_.nfwrd);\*

Error in posteriorzlb (line 61)\*  
[decrulea,decruleb]=get\_pq(oo00\_.dr);\*

Error in mhalgo (line 44)\*  
fval= feval(posterior\_func,theta,varargin{:});

Error in runsim\_metropolis (line 37)\*  
mhalgo(‘posteriorzlb’,params1,hessian\_fmin,target\_average,init\_draws,ndraws,load\_switch,jump,…

I use dynare 4.5.6 (I also try with 4.5.0 and I have the same message) as in the precedent discussion

---

<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:** [4 March 2020 13:26 UTC](https://forum.dynare.org/t/reference-to-non-existent-field-nstatic/15304/4 "2020-03-04T13:26:26Z")

</div>

The call to  
`[decrulea,decruleb]=get_pq(oo00_.dr);`  
needs to be  
`[decrulea,decruleb]=get_pq(oo00_.dr,M_);`

---

<div class="post-metadata">

**Author:** ![adar](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/58f4c7/32.png) [@adar](https://forum.dynare.org/u/adar)\
**Post date:** [4 March 2020 13:55 UTC](https://forum.dynare.org/t/reference-to-non-existent-field-nstatic/15304/5 "2020-03-04T13:55:41Z")

</div>

Thanks you so much! It works perfectly.
