Chapter 3 Topic 01

Heteroskedasticity and autocorrelation in systems of equations.

3.1 Motivation

Analyse the effect of heteroskdeasticty in systems of equations on SOLS estimator.

3.2 Probelm

Simulate a bivariate heteroskedasticity model for \(T=2000\) observations

\[\begin{align*} B y_t + A x_t &= u_t \\ u_t &\sim N\left(0, V_t = S_t S_t^{'}\right) \\ S_t &= C + D w_t \end{align*}\]

with,

\[\begin{align*} B &= \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}, \\ A &= \begin{bmatrix} -0.4 & 0 \\ 0 & 0.5 \end{bmatrix}, \\ C &= \begin{bmatrix} 1 & 0 \\ 0.5 & 2 \end{bmatrix}, \\ D &= \begin{bmatrix} 0.5 & 0 \\ 0.2 & 0.2 \end{bmatrix}, \end{align*}\]

and with,

\[\begin{align*} x_{1,t} &\sim iid \,\,\, U\left[0, 10\right], \\ x_{2,t} &\sim iid \,\,\, N\left(0, 9\right), \\ w_{1,t} &\sim iid \,\,\, U\left[0, 1\right], \end{align*}\]

3.3 Analysis

Simulation of the data (without contemporaneous relationships in \(y\))

t <- 2000

beta1  <- 0 # 0.6
alpha1 <- 0.4
beta2  <- 0 # 0.2
alpha2 <- -0.5

c11 <- 1.0
c21 <- 0.5
c22 <- 2.0

d11  <- 0.5
d21  <- 0.2
d22  <- 0.2

b <-  matrix(c(1, -beta2,
               -beta1, 1), nrow=2, byrow=T)
a <- matrix(c(-alpha1, 0,
              0, -alpha2), nrow=2, byrow=T)
c <-  matrix(c(c11,  0,
               c21, c22), nrow=2, byrow=T)
d <-  matrix(c(d11,  0,
               d21,  d22), nrow=2, byrow=T)
# Exogenous variables
x <- cbind(10*runif(t), 3*rnorm(t))
w <- runif(t)

# Disturbances
zeros <- array(0, c(t,2))
u <- zeros
for (i in seq(t)) {
  l     <- c + d * w[i]
  u[i,] <- rnorm(2) %*% t(l)
}

# Simulate the reduced form
y <- zeros
for (i in seq(t)) {
  y[i,] <- -x[i,] %*% a %*% solve(b) + u[i,] %*% solve(b)
}

Estimation of \(A\) using OLS (without contemporaneous relationships in \(y\))

# OLS fitting
lm.res <- lm(y ~ x - 1)

# compare estimates
t(lm.res$coefficients)
##               x1           x2
## [1,] 0.387367424 -0.005222276
## [2,] 0.004203001 -0.513489887
b.a <- solve(b) %*% -a
b.a
##      [,1] [,2]
## [1,]  0.4  0.0
## [2,]  0.0 -0.5

Estimation of \(V\) (without contemporaneous relationships in \(y\))

Sig.u <- 1/nrow(lm.res$residuals) * t(lm.res$residuals) %*% lm.res$residuals
Sig.u
##           [,1]      [,2]
## [1,] 1.5950007 0.8120818
## [2,] 0.8120818 4.7884989
# reconstruct (average) Sig
l <- c + d * 0.5
V <- l %*% t(l)
V
##        [,1] [,2]
## [1,] 1.5625 0.75
## [2,] 0.7500 4.77

Simulation of the data (with contemporaneous relationships in \(y\))

t <- 2000

beta1  <- 0.6
alpha1 <- 0.4
beta2  <- 0.2
alpha2 <- -0.5

c11 <- 1.0
c21 <- 0.5
c22 <- 2.0

d11  <- 0.5
d21  <- 0.2
d22  <- 0.2

b <-  matrix(c(1, -beta2,
               -beta1, 1), nrow=2, byrow=T)
a <- matrix(c(-alpha1, 0,
              0, -alpha2), nrow=2, byrow=T)
c <-  matrix(c(c11,  0,
               c21, c22), nrow=2, byrow=T)
d <-  matrix(c(d11,  0,
               d21,  d22), nrow=2, byrow=T)
# Exogenous variables
x <- cbind(10*runif(t), 3*rnorm(t))
w <- runif(t)

# Disturbances
zeros <- array(0, c(t,2))
u <- zeros
for (i in seq(t)) {
  l     <- c + d * w[i]
  u[i,] <- rnorm(2) %*% t(l)
}

# Simulate the reduced form
y <- zeros
for (i in seq(t)) {
  y[i,] <- -x[i,] %*% a %*% solve(b) + u[i,] %*% solve(b)
}

Estimation of the parameters using OLS (with contemporaneous relationships in \(y\))

# OLS fitting
lm.res <- lm(y ~ x - 1)

# compare estimates
t(lm.res$coefficients)
##              x1         x2
## [1,] 0.45697825 -0.3482923
## [2,] 0.08860531 -0.5814871
b.a <- solve(b) %*% -a
b.a
##           [,1]       [,2]
## [1,] 0.4545455 -0.1136364
## [2,] 0.2727273 -0.5681818

Estimation of \(V\) (with contemporaneous relationships in \(y\))

Sig.u <- 1/nrow(lm.res$residuals) * t(lm.res$residuals) %*% lm.res$residuals
Sig.u
##          [,1]     [,2]
## [1,] 5.194421 4.996690
## [2,] 4.996690 6.429859
# reconstruct (average) Sig
l <- c + d * 0.5
V <- l %*% t(l)
V
##        [,1] [,2]
## [1,] 1.5625 0.75
## [2,] 0.7500 4.77

Cholesky decomposition of \(V\)

S <- chol(Sig.u)
S
##          [,1]     [,2]
## [1,] 2.279127 2.192370
## [2,] 0.000000 1.274116
t(S) %*% S
##          [,1]     [,2]
## [1,] 5.194421 4.996690
## [2,] 4.996690 6.429859
Sig.u
##          [,1]     [,2]
## [1,] 5.194421 4.996690
## [2,] 4.996690 6.429859