Professional Documents
Culture Documents
Assignment 4 HUL315
Assignment 4 HUL315
Assignment 4
Submitted by: Vishal Kumar Saw (2020ME10985)
ln It = β0 + β1 ln it + β2 ∆ ln CP It + β3 ln Yt + β4 t + ut (1)
Where:
• It : Real investment
• Yt : Real GDP
• t: Time trend
• β0 , β1 , β2 , β3 , β4 : Coefficients to be estimated
• ut : Error term
Additionally, we will test the hypothesis that investors primarily focus on the real interest
rate, i.e., β1 = −β2 .
To test the relationship between the real interest rate and inflation, we formulate the
following hypotheses:
H0 : β1 = −β2
H1 : β1 ̸= −β2
Python Code:
1 import pandas as pd
2 import numpy as np
3 import statsmodels . api as sm
4
8 # Prepare variables
9 df [ ’ del_ln_CPI_t ’] = df [ ’ Delta_CPI ’]
10 df [ ’ ln_I_t ’] = np . log ( df [ ’ I_t ’ ])
11 df [ ’ ln_i_t ’] = np . log ( df [ ’ i_t ’ ])
1
12 df [ ’ ln_Y_t ’] = np . log ( df [ ’ Y_t ’ ])
13
14 # Drop the first row since it has NaN value for Delta_ln_CPI
15 df = df . dropna ()
16
17 # Estimation
18 X = df [[ ’ ln_i_t ’ , ’ ln_CPI ’ , ’ ln_Y_t ’ , ’t ’ ]]
19 X = sm . add_constant ( X )
20 y = df [ ’ ln_I_t ’]
21 model = sm . OLS (y , X ) . fit ()
22
Summary:
2
Result of test
From above summary table we can conclude that we reject the null hypotheses that
mean investors do not primarily focus on the real interest rate, implying that the coef-
ficient of the nominal interest rate (β1 ) in the investment equation is not equal to the
negative of coefficient of inflation (β2 )