# Expressing observed variables

**URL:** <https://forum.dynare.org/t/expressing-observed-variables/13448>\
**Category:** Estimation\
**Created:** [21 March 2019 09:39 UTC](https://forum.dynare.org/t/expressing-observed-variables/13448 "2019-03-21T09:39:55Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![steve\_1983](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/71e660/32.png) [@steve\_1983](https://forum.dynare.org/u/steve_1983)\
**Post date:** [21 March 2019 09:39 UTC](https://forum.dynare.org/t/expressing-observed-variables/13448/1 "2019-03-21T09:39:55Z")

</div>

Hi,

I had a question about how to express observed variables under var\_obs. For example, the  
interest rate in my data are the three month Treasury rate, APR, i.e., 400\* r, where r= log (R/R\_s) and R  
denotes the model gross nominal rate of interest rate and R\_s is its steady state value.

So if I write r under var\_obs, that will definitely lead to errors unless I introduce another variable called r and introduce one more equation saying r=400\*log(R/R\_s).

How do I overcome this problem.

Also, if I try to write xls\_sheet=1 and xls\_range=A1:C87, it leads to errors

“line 65, cols 55-60: syntax error, unexpected QUOTED\_STRING”

Thanks  
Steve

---

<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 March 2019 09:38 UTC](https://forum.dynare.org/t/expressing-observed-variables/13448/2 "2019-03-27T09:38:29Z")

</div>

For the error, I would need to see the codes.  
Regarding the `varobs`, what exactly is your data treatment. In your post above I cannot discern what is in the model and what is the data treatment.

---

<div class="post-metadata">

**Author:** ![steve\_1983](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/71e660/32.png) [@steve\_1983](https://forum.dynare.org/u/steve_1983)\
**Post date:** [30 March 2019 15:39 UTC](https://forum.dynare.org/t/expressing-observed-variables/13448/3 "2019-03-30T15:39:11Z")

</div>

Hi,

I am estimating a basic CGG model (mod file attached). The observed data are (i) log, first differenced GDP (i.e, yt in the model), (ii) the interest rate (the three month Treasury rate, APR, i.e., 400 \* rt, where rt = log (Rt=R) and Rt denotes the model gross nominal rate of interest rate and R is its steady state value) and (iii) inflation (log, first-difference of GDP deflator). Model data are expressed relative to their steady state value.

My question is my observed interest rate in data and my model interest rate are different.  
So if I write r under var\_obs, that will definitely lead to errors because it refers to r=400\*log(R/R\_s) which is different from the model interest rate R. The mod file and data are attached for your reference.

[cggest.mod](https://forum.dynare.org/uploads/default/original/2X/4/48440f52004de6e90a235162eedc010b8db9d3e2.mod) (3.2 KB)  
[data\_q\_on\_q.xls](https://forum.dynare.org/uploads/default/original/2X/d/d0d1355f525a9ba774f61c3156e20acd33ef3fd5.xls) (31 KB)  
.

---

<div class="post-metadata">

**Author:** ![steve\_1983](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/71e660/32.png) [@steve\_1983](https://forum.dynare.org/u/steve_1983)\
**Post date:** [12 April 2019 15:36 UTC](https://forum.dynare.org/t/expressing-observed-variables/13448/4 "2019-04-12T15:36:35Z")

</div>

Request someone to reply to this please. Thanks.

---

<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:** [15 April 2019 19:57 UTC](https://forum.dynare.org/t/expressing-observed-variables/13448/5 "2019-04-15T19:57:34Z")

</div>

I still don’t understand your transformations. Why is there an equal sign in the brackets of the log.

> [@Bringing model to the data](https://forum.dynare.org/t/bringing-model-to-the-data/11390/2):
>
> Please first read [Pfeifer(2013): “A Guide to Specifying Observation Equations for the Estimation of DSGE Models”](https://drive.google.com/file/d/1r89OU5OE3CBa6tOlj6l3hNVWEaRH5Anv/view?usp=sharing)

---

<div class="post-metadata">

**Author:** ![steve\_1983](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/71e660/32.png) [@steve\_1983](https://forum.dynare.org/u/steve_1983)\
**Post date:** [18 April 2019 14:00 UTC](https://forum.dynare.org/t/expressing-observed-variables/13448/6 "2019-04-18T14:00:27Z")

</div>

> [@steve\_1983](#):
>
> rt = log (Rt=R)

That was just a typo. It is r(t) = log (R(t)/R)

---

<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:** [22 April 2019 17:01 UTC](https://forum.dynare.org/t/expressing-observed-variables/13448/7 "2019-04-22T17:01:39Z")

</div>

Again, why do you think your data treatment for the interest rate is incorrect? If you want to be sure, please read Pfeifer(2013): “[A Guide to Specifying Observation Equations for the Estimation of DSGE Models](http://sites.google.com/site/pfeiferecon/Pfeifer_2013_Observation_Equations.pdf)

---

<div class="post-metadata">

**Author:** ![steve\_1983](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/71e660/32.png) [@steve\_1983](https://forum.dynare.org/u/steve_1983)\
**Post date:** [22 April 2019 17:18 UTC](https://forum.dynare.org/t/expressing-observed-variables/13448/8 "2019-04-22T17:18:10Z")

</div>

Many Thanks. When I did not understand the paper, I came to this forum.

---

<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:** [22 April 2019 17:55 UTC](https://forum.dynare.org/t/expressing-observed-variables/13448/9 "2019-04-22T17:55:41Z")

</div>

Then please try to carefully explain in detail what you question is.

---

<div class="post-metadata">

**Author:** ![steve\_1983](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/71e660/32.png) [@steve\_1983](https://forum.dynare.org/u/steve_1983)\
**Post date:** [22 April 2019 17:58 UTC](https://forum.dynare.org/t/expressing-observed-variables/13448/10 "2019-04-22T17:58:49Z")

</div>

Thanks for your time.
