I decided to use monthly r, inflation, GDP to jointly estimate r* with LM model.But when I deal with LW model with monthly data,I found in https://www.newyorkfed.org/research/policy/rstar R code, LW model set inflation with 8 lags in phillips curve while calculate Inflation expectations as follows,
Code: Select all
y.pi <- (inflation + Lag(inflation,k=1) + Lag(inflation,k=2) + Lag(inflation,k=3))/4
x.pi <- cbind(Lag(inflation,k=4),
Lag(inflation,k=5),
Lag(inflation,k=6))
data.pi <- cbind(y.pi, x.pi, union = TRUE)
end.period <- length(y.pi)
PI.EXP <- rep(NA,1,end.period+6)
for (t in seq(4,(end.period-39),1)){
Y <- data.pi[seq(t,t+39,1),1]
X <- cbind(as.matrix(data.pi[seq(t,t+39,1),c(2,3,4)]),
rep(1,length(Y)))
beta <- solve(t(X)%*%X)%*%t(X)%*%Y
PI.EXP[t+48] <- c(as.matrix(data.pi[t+43,c(2,3,4)]),1)%*%beta
}I know it's a bit inappropriate to post the R code here, but I think this is the best way to describe how it calculates expectations, so please forgive my rudeness.I just want to know why it Why is it calculate Inflation expectations this way?when I use monthly inflation data,can I just calculate average of the sum of inflation and its 11 lags as Inflation expectations?I know it's a basic question, but I searched it and didn't find an answer to my doubt.
with much appreciation,
H