# How many measurement error would be best?

**URL:** <https://forum.dynare.org/t/how-many-measurement-error-would-be-best/5130>\
**Category:** Dynare help (legacy posts)\
**Created:** [17 November 2015 10:40 UTC](https://forum.dynare.org/t/how-many-measurement-error-would-be-best/5130 "2015-11-17T10:40:03Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZBCPA](https://forum.dynare.org/letter_avatar_proxy/v4/letter/z/aeb1de/32.png) [@ZBCPA](https://forum.dynare.org/u/ZBCPA)\
**Post date:** [17 November 2015 10:40 UTC](https://forum.dynare.org/t/how-many-measurement-error-would-be-best/5130/1 "2015-11-17T10:40:03Z")

</div>

Dear Johhanes,

Could I ask two short questions?  
1.When doing bayesian estimation, I see some paper add one measurement error(e.g. What’s news in business cycles); while some add many measurement errors (e.g. real business cycles in emerging countries). Could you help explain why?

1. When using Observable variable of “hours worked”, some paper use growth rate of h, while some paper use pecentage deviation from steady state. Does such difference matter?

Many thanks in advance.

Best regards,  
Bo

---

<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 November 2015 13:48 UTC](https://forum.dynare.org/t/how-many-measurement-error-would-be-best/5130/2 "2015-11-17T13:48:19Z")

</div>

Please read Pfeifer(2013): “A Guide to Specifying Observation Equations for the Estimation of DSGE Models” [sites.google.com/site/pfeiferecon/Pfeifer\_2013\_Observation\_Equations.pdf](https://sites.google.com/site/pfeiferecon/Pfeifer_2013_Observation_Equations.pdf). Both topics are discussed there.

---

<div class="post-metadata">

**Author:** ![ZBCPA](https://forum.dynare.org/letter_avatar_proxy/v4/letter/z/aeb1de/32.png) [@ZBCPA](https://forum.dynare.org/u/ZBCPA)\
**Post date:** [18 November 2015 00:46 UTC](https://forum.dynare.org/t/how-many-measurement-error-would-be-best/5130/3 "2015-11-18T00:46:29Z")

</div>

> [@jpfeifer](#):
>
> Please read Pfeifer(2013): “A Guide to Specifying Observation Equations for the Estimation of DSGE Models” [sites.google.com/site/pfeiferecon/Pfeifer\_2013\_Observation\_Equations.pdf](https://sites.google.com/site/pfeiferecon/Pfeifer_2013_Observation_Equations.pdf). Both topics are discussed there.

Many thanks. Sure, I have seen your guide for many times. But I am still not sure how many measurement errors I can add in measurement equations as \*\*Exogenous variables,\*\*since I do not see any example in any published paper. To make the shocks no less than observables, I need at least 2 measurement errors as exgoneous variables.  
Is it O.K like:

[code]var\_exo …y\_Me c\_Me i\_Me h\_Me;  
model;  
…  
y\_obs=y-y(-1)+d+log(dbar)+y\_Me;  
c\_obs=c-c(-1)+d+log(dbar)+c\_Me;  
i\_obs=i-i(-1)+d+log(dbar)+i\_Me;  
h\_obs=h-h(-1)+h\_Me;  
end;

estimated\_pramams;  
stderr y\_Me;  
stderr c\_Me;  
stderr i\_Me;  
stderr h\_Me;  
…  
end;  
varobs y\_obs c\_obs i\_obs h\_obs;[/code]

Best regards,  
Huan

---

<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:** [18 November 2015 10:11 UTC](https://forum.dynare.org/t/how-many-measurement-error-would-be-best/5130/4 "2015-11-18T10:11:23Z")

</div>

What do you mean with as “exogenous variables”. As detailed in Chapter 6 of my Guide, using “Measurement Errors as a Special Case of Exogenous variables” is equivalent to regular measurement error using Dynare capabilities (i.e. in the observation equation of the Kalman filter). Thus, the papers you cite use that type of measurement error and what you try to do is done in the Garcia-Cicco et al (2010) AER paper and is a valid approach.

---

<div class="post-metadata">

**Author:** ![econ86](https://forum.dynare.org/letter_avatar_proxy/v4/letter/e/d9b06d/32.png) [@econ86](https://forum.dynare.org/u/econ86)\
**Post date:** [18 November 2015 16:10 UTC](https://forum.dynare.org/t/how-many-measurement-error-would-be-best/5130/5 "2015-11-18T16:10:59Z")

</div>

Dear all,

I read the paper in which authors estimate a DSGE model with measurement errors:  
y\_obs = y - y(-1) + epsilon\_me\_y.

The variance of the measurement errors is calibrated so that it corresponds to 10% of the variance in each data series.

After estimation authors report the following table (see file attached). My question is: how the numbers in the last column (i.e. structural explanation) are calculated?

Regards,  
[Measurement\_error.pdf](https://forum.dynare.org/uploads/default/original/2X/3/35e781158f2e06bb962fda4497e2777e7aafd807.pdf) (47 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:** [18 November 2015 19:01 UTC](https://forum.dynare.org/t/how-many-measurement-error-would-be-best/5130/6 "2015-11-18T19:01:41Z")

</div>

By comparing the variance of the observed variable without measurement error

```auto

```

to the one with measurement error

```auto

```

---

<div class="post-metadata">

**Author:** ![econ86](https://forum.dynare.org/letter_avatar_proxy/v4/letter/e/d9b06d/32.png) [@econ86](https://forum.dynare.org/u/econ86)\
**Post date:** [19 November 2015 06:09 UTC](https://forum.dynare.org/t/how-many-measurement-error-would-be-best/5130/7 "2015-11-19T06:09:00Z")

</div>

Thank you for your answer. So, if I understand you correctly I need to compare theoretical variance (calculated at posterior mean, for example) when

var epsilon\_me\_y;  
stderr 0;

and without this restriction?

---

<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:** [19 November 2015 07:04 UTC](https://forum.dynare.org/t/how-many-measurement-error-would-be-best/5130/8 "2015-11-19T07:04:11Z")

</div>

Either that or you simply define

`y_growth=y - y(-1);
y_obs=y_growth+epsilon_me_y;`  
and then compare the variance of the two.

---

<div class="post-metadata">

**Author:** ![econ86](https://forum.dynare.org/letter_avatar_proxy/v4/letter/e/d9b06d/32.png) [@econ86](https://forum.dynare.org/u/econ86)\
**Post date:** [19 November 2015 09:43 UTC](https://forum.dynare.org/t/how-many-measurement-error-would-be-best/5130/9 "2015-11-19T09:43:23Z")

</div>

Thank you for your help. I augmented my model with (measurement) equations without measurement errors (denoted as \_nome in table below) as you suggested. After doing so I run my model using stoch\_simul command (using calibrated parameters) and I get the following:

THEORETICAL MOMENTS  
VARIABLE MEAN STD. DEV. VARIANCE  
pi\_obs 0.0100 0.0090 0.0001  
dy\_obs 0.0060 0.0307 0.0009  
dc\_obs 0.0060 0.1556 0.0242  
dg\_obs 0.0060 0.0327 0.0011  
di\_obs 0.0060 0.0591 0.0035  
dm\_obs 0.0060 0.0180 0.0003  
dx\_obs 0.0060 0.0345 0.0012  
pi\_def\_c\_obs 0.0100 0.0088 0.0001  
reer\_obs 0.0000 0.1398 0.0196  
dw\_obs 0.0060 0.0079 0.0001  
e\_obs 0.0000 0.1024 0.0105  
dyfor\_obs 0.0060 0.0063 0.0000  
pifor\_obs 0.0100 0.0029 0.0000  
rfor\_obs 0.1226 0.0638 0.0041  
r\_obs 0.1226 0.0658 0.0043  
pi\_def\_i\_obs 0.0100 0.0081 0.0001  
pi\_obs\_nome 0.0100 0.0090 0.0001  
pi\_def\_c\_obs\_nome 0.0100 0.0088 0.0001  
dy\_obs\_nome 0.0060 0.0307 0.0009  
dc\_obs\_nome 0.0060 0.1556 0.0242  
di\_obs\_nome 0.0060 0.0587 0.0034  
dm\_obs\_nome 0.0060 0.0176 0.0003  
dx\_obs\_nome 0.0060 0.0344 0.0012  
dg\_obs\_nome 0.0060 0.0327 0.0011  
reer\_obs\_nome 0.0000 0.1398 0.0196  
e\_obs\_nome 0.0000 0.1023 0.0105  
dw\_obs\_nome 0.0060 0.0079 0.0001  
r\_obs\_nome 0.1226 0.0655 0.0043  
pi\_def\_i\_obs\_nome 0.0100 0.0080 0.0001

There is no difference between std/variance of respective variable when there is measurement error and without measurement error.

P.S.: I calibrated the standard deviation of the measurement errors so that it corresponds to 10% of the standard deviation in each data series. For example, for output growth:

var epsilon\_me\_y  
stderr 0.00118 = 0.10_std(data)=0.10_0.0118;

---

<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:** [21 November 2015 14:55 UTC](https://forum.dynare.org/t/how-many-measurement-error-would-be-best/5130/10 "2015-11-21T14:55:13Z")

</div>

Please provide the full file.

---

<div class="post-metadata">

**Author:** ![econ86](https://forum.dynare.org/letter_avatar_proxy/v4/letter/e/d9b06d/32.png) [@econ86](https://forum.dynare.org/u/econ86)\
**Post date:** [23 December 2015 06:34 UTC](https://forum.dynare.org/t/how-many-measurement-error-would-be-best/5130/11 "2015-12-23T06:34:38Z")

</div>

To calculate the so-called structural explanation I specified:  
y\_growth=y - y(-1);  
y\_obs=y\_growth+epsilon\_me\_y;

ect.

When estimating the model, the variables declared under varobs command are only those with measurement error, i.e. y\_obs. Is this ok?

Should I declare also y\_growth?

---

<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 December 2015 09:30 UTC](https://forum.dynare.org/t/how-many-measurement-error-would-be-best/5130/12 "2015-12-23T09:30:05Z")

</div>

Yes, this is OK.  
I finally found time to look at your initial issue. The reason is that stoch\_simul currently ignores measurement error. Thus, the moments for the variables without measurement error are correct, but the ones with measurement error are understated.

---

<div class="post-metadata">

**Author:** ![econ86](https://forum.dynare.org/letter_avatar_proxy/v4/letter/e/d9b06d/32.png) [@econ86](https://forum.dynare.org/u/econ86)\
**Post date:** [24 December 2015 07:36 UTC](https://forum.dynare.org/t/how-many-measurement-error-would-be-best/5130/13 "2015-12-24T07:36:12Z")

</div>

Thank you very much for your answer.

If I understand you correctly, stoch\_simul currently ignores all shocks that are included in an additive way?

---

<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 December 2015 19:05 UTC](https://forum.dynare.org/t/how-many-measurement-error-would-be-best/5130/14 "2015-12-27T19:05:07Z")

</div>

My mistake. I overlooked that you specified the measurement error as a structural shock. stoch\_simul is able to handle this. However, your measurement error hardly plays a role. When you look at the variance decomposition, they tend to explain 1% or less of the total variance. This will be hardly noticeable in the moments table.

---

<div class="post-metadata">

**Author:** ![econ86](https://forum.dynare.org/letter_avatar_proxy/v4/letter/e/d9b06d/32.png) [@econ86](https://forum.dynare.org/u/econ86)\
**Post date:** [19 January 2016 10:10 UTC](https://forum.dynare.org/t/how-many-measurement-error-would-be-best/5130/15 "2016-01-19T10:10:02Z")

</div>

I estimated my DSGE model with measurement error shocks. I included measurement errors in the model due to the stochastic singularity problem (despite having more shocks than observables in the model!). The standard deviation of the measurement error shocks is calibrated so that it corresponds to 10% of the standard deviation in each data series. After estimation I calculated historical decomposition and found that some observable variables (especially different measures of inflation, that is CPI inflation and domestic inflation based on GDP deflator) are driven mainly by measurement error shock (figure attached). How can these results be interpreted?

P.S. The measurement equation for inflation is the following:  
pi\_obs = (pi\_ss - 1) + pi\_hat + epsilon\_me.

The historical decomposition is based on pi\_obs. Should I calculate historical decomposition based on pi\_hat?  
[HistDecom.pdf](https://forum.dynare.org/uploads/default/original/2X/b/b5085f66dbf21be94b440c40a934bf8e543236ae.pdf) (154 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 January 2016 19:01 UTC](https://forum.dynare.org/t/how-many-measurement-error-would-be-best/5130/16 "2016-01-24T19:01:39Z")

</div>

The picture is a bit strange, because it looks as if the measurement error accounts for more than 10% of the volatility.

Generally, a picture like this tells you that (believing that we do not mismeasure inflation that badly) your model is misspecified and thus has a hard time accounting for the movement of the observables with other types of shocks.
