You are on page 1of 2

Inflation and excess demand

Let pt be (the log) of CPI, yt denotes (the log of) output in the selected country’s
economy (fixed prices), and yt* is the potential output (equilibrium growth path) for
the economy.Assume that the following simple relationship holds between the annual
rate of CPI growth, ∆pt, and “output gap” measured by the difference (yt - yt*).

What is the interpretation of the “output gap” in words?

∆𝑝𝑡 = 𝛼 + 𝛽∆𝑝𝑡−1 + 𝛾(𝑦𝑡 − 𝑦𝑡∗ ) + 𝜀𝑡 ……. (1)

1. Download the required data of your own country and import in R.


2. Calculate 𝑦𝑡∗ and 𝑦𝑡 − 𝑦𝑡∗ .
Note:
i. To compute 𝑦𝑡∗ , estimate the following equation (use ‘lm’ command) and
use fitted values as 𝑦𝑡∗ .
𝑦𝑡 = 𝑎 + 𝑏𝑌𝑒𝑎𝑟𝑠
ii. To compute ∆, use ‘diff’ command in R. You may take logarithms in Excel.

3. Estimate equation (1) and interpret the summary of results.


4. Write the results in table form.
5. Apply/compute the following tests to residuals of the model.
a. ACF/PACF and interpret the outcome in terms of residual’s stationarity.
b. ADF test to confirm the results in step ‘a’.
c. Autocorrelation tests

Answer:
>tsdata=ts(r_assignment, start=1960)
> reg1=lm(log(yt)~year,data=r_assignment)
> View(reg1)
> ytstar=reg1[["residuals"]]
> ygap=log(r_assignment$yt)-ytstar
> r_assignment$og=ygap
> tsdata=ts(r_assignment, start=1960)
> reg2 = dynlm(formula = (diff(log(Pt))) ~ L(diff(log(Pt))) + og, data =
tsdata)
> #to check the signifiance of the regression, we see the p-values in the
regression where H0=0 and H1≠0 with the decision rule to reject H0 if p-
value<0.05.
> #in this regression, we see that the p-value for L(diff(log(pt)))=
0.000134<0.005 hence it is a significant predictor of diff(log(pt)) while the p-
value for OG=0.320454>0.05 hence we conclude that is not a significant
predictor for diff(log(pt)).
> stargazer(reg2,type="text")
> res=residuals(reg2)
> acf(res)
> pacf(res) > #H0: corr=0 (no correlation) if all black lines in pacf are in
between the two blue lines
#can also conclude if black lines between blue, that this residual series is
stationary (no unit root issue)
In this case we can conclude that there exists correlation in these residuals as
one of the black lines is not contained within the two blue lines. We can also
conclude that there is a problem of non-stationary among them.
> (adf.test(res)) > #H0=non-stationary exists. H1=stationarity exists. decision
rule=reject H0 if p-value<0.05.
> #in this adf test, the p-value=0.01<0.05 hence we reject H0 and conclude
that stationarity exists.
> #the problem we face in this is that pacf result showed nonstationarity in
2nd lags while adf-test p-value shows that the residuals are stationary.
>Box.test(res,lag=5) > #H0= no autocorrelation, H1= autocorrelaion exists.
decision rule=reject H0 if p-value<0.05
> #the p-value here = 0.02099>0.05 hence we DO reject H0 and conclude
that autocorrelation does exist in this model.
>(dwtest(reg2)) > #H0= no autocorrelation, H1= autocorrelaion exists.
decision rule=reject H0 if p-value<0.05
> #the p-value here = 0.04333>0.05 hence we DO reject H0 and conclude
that autocorrelation does exist in this model.

You might also like