# Question about estimation

**URL:** <https://forum.dynare.org/t/question-about-estimation/22614>\
**Category:** Estimation\
**Created:** [18 June 2023 08:53 UTC](https://forum.dynare.org/t/question-about-estimation/22614 "2023-06-18T08:53:52Z")\
**Posts on this page:** 20\
**Page:** 4

<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:** [23 October 2023 06:52 UTC](https://forum.dynare.org/t/question-about-estimation/22614/61 "2023-10-23T06:52:01Z")

</div>

1. You are missing a semicolon after `stoch_simul`.
2. You are not using the unstable version but Dynare 5.4.

---

<div class="post-metadata">

**Author:** ![redbanana](https://forum.dynare.org/user_avatar/forum.dynare.org/redbanana/32/12120_2.png) [@redbanana](https://forum.dynare.org/u/redbanana)\
**Post date:** [23 October 2023 08:37 UTC](https://forum.dynare.org/t/question-about-estimation/22614/62 "2023-10-23T08:37:36Z")

</div>

So which version should I use (do you have a link?)? I tried downloading the 4.6 unstable version at  
[https://archives.dynare.org/download/dynare-unstable.html](https://archives.dynare.org/download/dynare-unstable.html)  
but I end up at an 404 error website: [https://www.dynare.org/snapshot/windows-zip/dynare-4.6-unstable-123ba26-win.zip](https://www.dynare.org/snapshot/windows-zip/dynare-4.6-unstable-123ba26-win.zip)

---

<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:** [23 October 2023 08:53 UTC](https://forum.dynare.org/t/question-about-estimation/22614/63 "2023-10-23T08:53:21Z")

</div>

At the bottom of [Download | Dynare](https://www.dynare.org/download/)

---

<div class="post-metadata">

**Author:** ![redbanana](https://forum.dynare.org/user_avatar/forum.dynare.org/redbanana/32/12120_2.png) [@redbanana](https://forum.dynare.org/u/redbanana)\
**Post date:** [23 October 2023 10:21 UTC](https://forum.dynare.org/t/question-about-estimation/22614/64 "2023-10-23T10:21:33Z")

</div>

Great news, using latest unstable verson of Dynare, Octave 8.3 finally manages to open all 10 figures and window doesn’t freeze. However, I still obtain an error message:

You did not declare endogenous variables after the estimation/calib\_smoother command.  
error: Estimation: the ‘estimated\_params’ block is mandatory (unless you are running a smoother)  
error: called from  
dynare\_estimation\_init at line 221 column 9  
dynare\_estimation\_1 at line 114 column 93  
dynare\_estimation at line 118 column 5  
driver at line 798 column 14  
dynare at line 301 column 5

[Model.mod](https://forum.dynare.org/uploads/short-url/osydExm4rKbgjimHnWAJYDa2UWZ.mod) (2.5 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:** [23 October 2023 10:55 UTC](https://forum.dynare.org/t/question-about-estimation/22614/65 "2023-10-23T10:55:07Z")

</div>

But what are you trying to do?

---

<div class="post-metadata">

**Author:** ![redbanana](https://forum.dynare.org/user_avatar/forum.dynare.org/redbanana/32/12120_2.png) [@redbanana](https://forum.dynare.org/u/redbanana)\
**Post date:** [23 October 2023 11:10 UTC](https://forum.dynare.org/t/question-about-estimation/22614/66 "2023-10-23T11:10:34Z")

</div>

My goal is to estimate DSGE model on real world data using quarterly data for 3 countries via Metropolis-Hastings algorithm (subtype Random Walk Metropolis). Later on I plan to use ESS procedure (introduced by Inoue and Rossi) to test structural parameters for potential breaks (parameter instability).

---

<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:** [23 October 2023 11:13 UTC](https://forum.dynare.org/t/question-about-estimation/22614/67 "2023-10-23T11:13:55Z")

</div>

I see. Currently, you are missing the block defining which parameters to estimate.

---

<div class="post-metadata">

**Author:** ![redbanana](https://forum.dynare.org/user_avatar/forum.dynare.org/redbanana/32/12120_2.png) [@redbanana](https://forum.dynare.org/u/redbanana)\
**Post date:** [23 October 2023 11:53 UTC](https://forum.dynare.org/t/question-about-estimation/22614/68 "2023-10-23T11:53:32Z")

</div>

I plan to estimate consumption, investment, money aggregates, inflation and interest rates. Do you have any example on how to write the code for this block? I tried estimated\_params; but I obtain an error message and no figure pops up. Thank you.

---

<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:** [24 October 2023 09:14 UTC](https://forum.dynare.org/t/question-about-estimation/22614/69 "2023-10-24T09:14:26Z")

</div>

Always provide the full error message. There is the `fs2000.mod` in the `examples`-folder of your Dynare installation.

---

<div class="post-metadata">

**Author:** ![redbanana](https://forum.dynare.org/user_avatar/forum.dynare.org/redbanana/32/12120_2.png) [@redbanana](https://forum.dynare.org/u/redbanana)\
**Post date:** [24 October 2023 10:54 UTC](https://forum.dynare.org/t/question-about-estimation/22614/70 "2023-10-24T10:54:56Z")

</div>

In the estimated\_params block, I included only the estimated parameters, not fixed ones (like beta = 0.99). I hope this is alright. I also noticed that logarythmic variables are written like lne and lnz in the beginning of .MOD file, however in the equations they appear in the brackets, e.g. ln(e). Is this correct?

Here is error message.

渕Starting Dynare (version 6-unstable-2023-10-21-1022-d95154ff).  
Calling Dynare with arguments: none  
Starting preprocessing of the model file …  
ERROR: Model.mod: line 90, cols 1-2: syntax error, unexpected LN

Preprocessing time: 0h00m00s.  
error: Dynare: preprocessing failed  
error: called from  
dynare at line 288 column 5

The numbers in estimated\_params block are means and standard deviations.

[Model.mod](https://forum.dynare.org/uploads/short-url/3fBxeXTCp5pJgF2p6Oif7SZLGsP.mod) (3.1 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:** [24 October 2023 13:14 UTC](https://forum.dynare.org/t/question-about-estimation/22614/71 "2023-10-24T13:14:41Z")

</div>

What are you trying to do with e.g.

```auto
estimated_params;
ln(e), gamma_pdf, 1.39, 0.24;

```

? The syntax for estimated shocks would be  
estimated\_params;

alph, beta\_pdf, 0.3, 0.05;

phip, gamma\_pdf, 50, 10;

phik, gamma\_pdf, 32.14, 2.8;

rhoa, beta\_pdf, 0.75, 0.15;

rhoe, beta\_pdf, 0.75, 0.15;

rhox, beta\_pdf, 0.75, 0.15;

rhoz, beta\_pdf, 0.75, 0.15;

rhov, beta\_pdf, 0.5, 0.1;

```auto
stderr epsilone, gamma_pdf, 1.39, 0.24;

```

---

<div class="post-metadata">

**Author:** ![redbanana](https://forum.dynare.org/user_avatar/forum.dynare.org/redbanana/32/12120_2.png) [@redbanana](https://forum.dynare.org/u/redbanana)\
**Post date:** [24 October 2023 14:47 UTC](https://forum.dynare.org/t/question-about-estimation/22614/72 "2023-10-24T14:47:07Z")

</div>

Thanks, I am attaching new error messages.

 ![Error1](https://forum.dynare.org/uploads/default/original/3X/a/2/a24e21725ebfb1da053d130fae7a6bed1ed88447.png)

[Model.mod](https://forum.dynare.org/uploads/short-url/jyhLDbnltZGKJqRc0ZhnIRSSZlV.mod) (2.8 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:** [26 October 2023 20:12 UTC](https://forum.dynare.org/t/question-about-estimation/22614/73 "2023-10-26T20:12:09Z")

</div>

Can you provide the data file?

---

<div class="post-metadata">

**Author:** ![redbanana](https://forum.dynare.org/user_avatar/forum.dynare.org/redbanana/32/12120_2.png) [@redbanana](https://forum.dynare.org/u/redbanana)\
**Post date:** [27 October 2023 10:36 UTC](https://forum.dynare.org/t/question-about-estimation/22614/74 "2023-10-27T10:36:41Z")

</div>

I’m attaching the Data file. I don’t know if I have to refer to it in the Model file - I simply copied and pasted the Data file in the same folder as Model file. The data include quarterly data 1991Q1 - 2020Q1 for 3 countries (Slovenia, Austria and Italy) and 5 variables.

[Data.xls](https://forum.dynare.org/uploads/short-url/lbjMb8K3K2xcZkAJx5jol086LOH.xls) (79.5 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:** [27 October 2023 11:05 UTC](https://forum.dynare.org/t/question-about-estimation/22614/75 "2023-10-27T11:05:45Z")

</div>

There are at least two issues I spot immediately:

1. Octave seems to only supports `xlsx` files, not the older `xls` ones.
2. Your data has a panel structure and Dynare is not equipped to work with panels.

---

<div class="post-metadata">

**Author:** ![redbanana](https://forum.dynare.org/user_avatar/forum.dynare.org/redbanana/32/12120_2.png) [@redbanana](https://forum.dynare.org/u/redbanana)\
**Post date:** [27 October 2023 11:37 UTC](https://forum.dynare.org/t/question-about-estimation/22614/76 "2023-10-27T11:37:59Z")

</div>

I corrected both errors and I get one error message less.

 ![Error2](https://forum.dynare.org/uploads/default/original/3X/9/5/956a84aac4453f180f75643f4f70dfb8c1d7766d.png)

[Data.xlsx](https://forum.dynare.org/uploads/short-url/2Er4U9WECNh65WM9ZpGdVjdY6QG.xlsx) (23.8 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:** [27 October 2023 12:17 UTC](https://forum.dynare.org/t/question-about-estimation/22614/77 "2023-10-27T12:17:11Z")

</div>

Use `xls_range=B1:F118` to just point to the data without any dates.

---

<div class="post-metadata">

**Author:** ![redbanana](https://forum.dynare.org/user_avatar/forum.dynare.org/redbanana/32/12120_2.png) [@redbanana](https://forum.dynare.org/u/redbanana)\
**Post date:** [27 October 2023 15:07 UTC](https://forum.dynare.org/t/question-about-estimation/22614/78 "2023-10-27T15:07:10Z")

</div>

Do you mean as a simple line in .MOD file or as parameter at stoch\_simul? In both cases I get error messages…

ERROR: Model.mod: line 100, cols 33-41: syntax error, unexpected XLS\_RANGE

Preprocessing time: 0h00m00s.  
error: Dynare: preprocessing failed  
error: called from  
dynare at line 288 column 5

In case I just delete A column in Exel, I get this errors:

You did not declare endogenous variables after the estimation/calib\_smoother command.  
warning: gaminv: calculation failed to converge for some values.  
warning: called from  
gaminv at line 101 column 7  
prior\_bounds at line 91 column 26  
dynare\_estimation\_init at line 195 column 16  
dynare\_estimation\_1 at line 114 column 93  
dynare\_estimation at line 118 column 5  
driver at line 841 column 14  
dynare at line 301 column 5

error: makedataset: nobs (585) cannot be greater than the last date in the dataset (117)!  
error: called from  
makedataset at line 248 column 9  
dynare\_estimation\_init at line 388 column 48  
dynare\_estimation\_1 at line 114 column 93  
dynare\_estimation at line 118 column 5  
driver at line 841 column 14  
dynare at line 301 column 5

---

<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:** [28 October 2023 09:21 UTC](https://forum.dynare.org/t/question-about-estimation/22614/79 "2023-10-28T09:21:29Z")

</div>

> [@redbanana](#):
>
> Do you mean as a simple line in .MOD file or as parameter at stoch\_simul?

No, as an option to `estimation`. In such cases, please consult the manual first.  
2. The error message is pretty explicit. Don’t specify `nobs=585` if there are only 117 observations.

---

<div class="post-metadata">

**Author:** ![redbanana](https://forum.dynare.org/user_avatar/forum.dynare.org/redbanana/32/12120_2.png) [@redbanana](https://forum.dynare.org/u/redbanana)\
**Post date:** [28 October 2023 10:50 UTC](https://forum.dynare.org/t/question-about-estimation/22614/80 "2023-10-28T10:50:50Z")

</div>

Thank you, I corrected both mistakes, and I obtain two error messages:

鿙You did not declare endogenous variables after the estimation/calib\_smoother command.  
warning: gaminv: calculation failed to converge for some values.  
warning: called from  
gaminv at line 101 column 7  
prior\_bounds at line 91 column 26  
dynare\_estimation\_init at line 195 column 16  
dynare\_estimation\_1 at line 114 column 93  
dynare\_estimation at line 118 column 5  
driver at line 842 column 14  
dynare at line 301 column 5

error: dseries::subsref: Indices are out of bounds! Subsample cannot end after 117Y.  
error: called from  
subsref at line 258 column 13  
makedataset at line 253 column 15  
dynare\_estimation\_init at line 388 column 48  
dynare\_estimation\_1 at line 114 column 93  
dynare\_estimation at line 118 column 5  
driver at line 842 column 14  
dynare at line 301 column 5

I checked Dynare Manual at calib\_smoother chapter, but I didn’t find any relevant cases.

[Data.xlsx](https://forum.dynare.org/uploads/short-url/2Er4U9WECNh65WM9ZpGdVjdY6QG.xlsx) (23.8 KB)  
[Model.mod](https://forum.dynare.org/uploads/short-url/ozP0uYiO9bj8x8nkBRdU8IUetkw.mod) (2.8 KB)

[Previous page](https://forum.dynare.org/t/question-about-estimation/22614.md?page=3)

[Next page](https://forum.dynare.org/t/question-about-estimation/22614.md?page=5)
