Estimation of Taylor Rule

How to estimate the four parameters of the Augmented Taylor Rule
i_t=(1-ρ)α+(1-ρ)βπ_(t+n)+(1-ρ)γx_t+ρi_(t-1)+ε_t using Generalized Method of Moments (GMM)

Load packages (using the library() or require() functions)


Load data

dat <- read.csv("Australia.csv")

Define variables

dat <- ts(dat, start=c(2000,1), frequency=4)

Exclude rows with missing entries.

dat <- dat[complete.cases(dat), ]
data1 =

Create a function g(\theta; x) which returns an n * 3 matrix

gmm1 <- function(tet, data1)
m1 <- data1$R-(1-tet[2])*(tet[1]+tet[3]*data1$I+tet[4]*data1$G)+
f <- cbind(m1)

Compute the covariance matrix of parameters

Grand1 <- function(tet,data1)
h <- matrix(c( -(1-tet[2]),
(tet[1]+tet[3]*mean(data1$I)+tet[4]*mean(data1$G))+ mean(lag(data1$R,-1)),

Run GMM using the starting values

print(res <- momentModel(gmm1, data1, theta0=c(beta0=1, beta1=1,beta3=2), grad = Grand1))

I have tried to create the R code above, but I get this error: Some moments are NA's. Make sure you remove missing values from x.

Could any one please help me with this

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.