# Data handling

Dear Professor Pfeifer,

I am new in DSGE models and Dynare. I am trying to estimate a DSGE model and I need to make sure that I am transforming my data correctly. I have read your paper (very useful !!) but I would like to share my doubts. The (quarterly) observed data I use is: Output growth, Labour productivity growth, GDP deflator Inflation, CPI Inflation, Wage Inflation, Nominal interest rate, and Nominal currency depreciation. Time-series are seasonally adjusted. Also I am entering my model in log-linear form – model (linear).

All growth rates (and inflation rates) (for consistency purposes with respect to the model) are quarterly non-annualised, and computed as the first difference of their respective values, i.e. output growth = output(t) - output(t-1) and Inflation rates = Price(t) – Price(t-1). I have matched these computations with my model using the above observation equations. I also assume zero inflation, growth and depreciation at the steady state. So please lets talk about detrending and demeaning issues.

1. Output growth: I take the logs of real GDP, then I take the first difference. As far as I know, taking first difference detrends the data, right ?? So there is no need to apply the one-side HP filter as well, right?? Also since I assume zero growth at steady state , I have to demean the growth rate, right ??

2. Inflation: I take the first difference of the logs of the prices. Again I just only need to demean the Inflation series, right ???

Using the Uncovered Interest Parity in the obs equations I relate the interest rates with the currency depreciation.

1. Interest rates: ir_obs = log(1+ir_data/400) – the mean log(1+ir_data/400) ]

2. Nominal currency depreciation: log(s)-log(s-1) and then only demean it.

Could you please correct me Professor ??
Much appreciated.

1. Yes, you must not HP-filter the growth rates
2. Yes, you need to demean the quarterly price growth if you assume a 0 inflation steady state.
3. That looks correct if ir_data is an annualized net interest rate measured in percentage points while ir_obs is a quarterly net interest rate
4. If the exchange rate definition is consistent, this is also correct

I see. Can I ask a question regarding your paper’s Remark 10 (Scaling With a Factor 100) ?? Probably I didnt 100% understand it.

For example,In a log-lin model I want to use the inv Gamma distribution with prior mean of 0.5% for a shock’s std deviation.

1. If my data are scaled x100 then I should : inv_gamma_pdf, 0.5, inf; but if are not scaled then : inv_gamma_pdf, 0.005, inf; ???
2. Same changes must be made for the parameter’s priors as well or only for the shocks’ std deviations?
3. If all my data are scaled x100 (so I bring them in percent), I should leave the Federal fund rate as it is (in percent) right? I should not multiply it with 100 since its already in percent, correct? So only divide them by 4 in order to bring it in quarterly non-annualize form. I also see that in Smets and Wouter (2007) and Del Negro and Schorfheide (2012).

Much appreciated

Oh, and something more general. If I decide not to scale my data x100 due to comparability (of the forecasts) with some BVAR models (which are not scaled) , is it wrong?? Is it necessary for a DSGE to be scaled x100 ???

Much appreciated

If you are unsure, do not multiply by 100. That is the safest way.

Much appreciated

1. Use `inv_gamma_pdf, 0.005, inf; ` for the priors of the standard deviations if

is desired
2) This is only done for the standard deviations as they are the ones that are affected by the scaling
3) That depends on the exact observation equation used (e.g. net vs. gross etc.)

Professor, sorry about it but perhaps I miss something.

[quote]1) Use
CODE: SELECT ALL
inv_gamma_pdf, 0.005, inf;
for the priors of the standard deviations if inv Gamma distribution with prior mean of 0.5% is desired[/quote]

That setting is for scaled data or not? how should I set it if I do not scale them??

1. Also I see some papers that detrend all of their data by taking the log of the first differences except the nominal interest rate (they do not even hp filter them). Can you see any reason behind that ??

Much appreciated

1.) That is for non-scaled data, of course. Mathematically, 0.005 is 0.5%.
2.) Nominal interest rates do not have a (growth) trend that needs to be removed. They are already stationary, obviating the need for additional detrending.