# Adaptive learning

**URL:** <https://forum.dynare.org/t/adaptive-learning/14119>\
**Category:** Estimation\
**Created:** [9 July 2019 17:25 UTC](https://forum.dynare.org/t/adaptive-learning/14119 "2019-07-09T17:25:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![luishb1](https://forum.dynare.org/letter_avatar_proxy/v4/letter/l/b2d939/32.png) [@luishb1](https://forum.dynare.org/u/luishb1)\
**Post date:** [9 July 2019 17:25 UTC](https://forum.dynare.org/t/adaptive-learning/14119/1 "2019-07-09T17:25:31Z")

</div>

Hello everyone,

I am trying to estimate a model under adaptive learning. I am using the code provided by Slobodyan and Wouters (2012) ([https://www.aeaweb.org/articles?id=10.1257/mac.4.2.65](https://www.aeaweb.org/articles?id=10.1257/mac.4.2.65)). The problem is that this code only runs with dynare 3.64. My dynare code runs with the last version of dynare but not with this 3.64. The error message I get is:

```
Subscript indices must either be real positive integers or logicals.

Error in dr1 (line 139)
b = jacobia_(:,k0);

Error in resol (line 56)
[dr,info] = dr1(dr,check_flag);

Error in dynare_resolve (line 4)
  [dr_,info] = resol(ys_,0);

Error in DsgeLikelihood

Error in initial_estimation_checks (line 20)
  [fval,cost_flag,ys,trend_coeff,info] = DsgeLikelihood(xparam1,gend,data);

Error in dynare_estimation (line 249)
  initial_estimation_checks(xparam1,gend,data);

Error in RE (line 339)
dynare_estimation(var_list_);

Error in dynare (line 26)
evalin('base',fname) ;

```

I have read some post of this forum telling that this problem arises because of the timing. They say that all the variables should appear at time t in the model block. I have revised my model and I think this is not my problem.

I attach my mod file and data. I someone can take a look and provide any help I would really appreciate it.

Thank you very much in advance.

[DATA.mat](https://forum.dynare.org/uploads/short-url/7djds1zDVl3HKjVovgrxOFP7dM.mat) (17.6 KB) [RE.mod](https://forum.dynare.org/uploads/short-url/v3dOroVu28wktMFAPpQDPknAEcZ.mod) (8.3 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:** [10 July 2019 11:39 UTC](https://forum.dynare.org/t/adaptive-learning/14119/2 "2019-07-10T11:39:10Z")

</div>

@MichelJuillard Do you have an idea what is going on? The selector matrix for the Jacobian has a column of zeros in Dynare 3.64, but I have a hard time mapping that back to the variable involved.

---

<div class="post-metadata">

**Author:** ![MichelJuillard](https://forum.dynare.org/user_avatar/forum.dynare.org/micheljuillard/32/5318_2.png) [@MichelJuillard](https://forum.dynare.org/u/MichelJuillard)\
**Post date:** [29 November 2019 12:35 UTC](https://forum.dynare.org/t/adaptive-learning/14119/4 "2019-11-29T12:35:59Z")

</div>

I guess that the problem comes from the two variables r\_k and R\_k. Version 3.64 must be confused by the case difference. I don’t have version 3.64 so I can’t be completely sure.

---

<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:** [29 November 2019 14:16 UTC](https://forum.dynare.org/t/adaptive-learning/14119/5 "2019-11-29T14:16:08Z")

</div>

I can confirm that the error goes away once I rename `R_k` into `Rk`. So 3.64 indeed seems to incorrectly treat case-sensitive variable names.
