Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Economics

13 Large Samples and Dependence

National Graduate Institute for Policy Studies (GRIPS)

With IID data, the joint distribution of the sample is pinned down by the common marginal of the observations. The statistical learning problem becomes one of learning the marginal. With dependent data the joint distribution is more complex. The fundamental statistical problem has to be extended as follows:

Let’s look at how we might tackle this problem, starting with least squares.

13.1Large Sample Least Squares

Our treatment of least squares in this chapter permits dependent data but at the same time requires that the sample size is large. Large samples allow us to drop some of the strict parametric assumptions on the error term we made when we considered finite sample inference (see, e.g., assumption 12.1.5). In this sense, the theory developed below is also useful for cross-sectional environments with no correlation between observations.

13.1.1Setup and Assumptions

Let’s go back to the linear model assumption of chapter 12. That is, we assume that our data (y1,x1),…,(yT,xT)(y_1, \boldx_1), \ldots, (y_T, \boldx_T) are generated by the linear model

yt=xt⊺β+ut,t=1,…,T,y_t = \boldx_t^\T \boldbeta + u_t, \qquad t = 1, \ldots, T,

where β\boldbeta is a KK-vector of unknown coefficients, and utu_t is an unobservable shock. Observations are indexed by tt rather than nn to remind us that observations are dependent. The sample size will be denoted by TT.

We let y\boldy be the T×1T \times 1 vector of observed outputs, so that yty_t is the ttth element of y\boldy, and u\boldu be the vector of shocks, so that utu_t is the ttth element of u\boldu. We let X\boldX be the T×KT \times K matrix X:=(xtk)\boldX := (x_{tk}), where 1⩽t⩽T1 \leq t \leq T and 1⩽k⩽K1 \leq k \leq K.

We will estimate the parameter vector β\boldbeta via least squares. The OLS estimate is therefore unchanged at

β^T=[1T∑t=1Txtxt⊺]−1⋅  1T∑t=1Txtyt\hboldbeta_T = \left[ \frac{1}{T} \sum_{t=1}^T \boldx_t \boldx_t^\T \right]^{-1} \cdot \; \frac{1}{T} \sum_{t=1}^T \boldx_t y_t

(Recall (11.17).) The expression for the sampling error in (12.4) can be expanded into sums to obtain

β^T−β=[1T∑t=1Txtxt⊺]−1⋅  1T∑t=1Txtut\hboldbeta_T - \boldbeta = \left[ \frac{1}{T} \sum_{t=1}^T \boldx_t \boldx_t^\T \right]^{-1} \cdot \; \frac{1}{T} \sum_{t=1}^T \boldx_t u_t

In this section we drop the exogeneity assumption E [u ∣ X]=0\EE[\boldu \given \boldX] = \boldzero (assumption 12.1.3) because it excludes too many dynamic models. For example, we know from Section 12.2.2 that exogeneity fails when we try to estimate the simple AR(1) model yt+1=βyt+ut+1y_{t+1} = \beta y_t + u_{t+1} by setting xt=yt−1x_t = y_{t-1}, thereby producing the regression model

yt=βxt+ut,t=1,…,Ty_t = \beta x_t + u_t, \qquad t=1,\ldots,T

For this specification of (13.1), the regressor is correlated with lagged values of the shock.

The full column rank condition is the same as assumption 11.1.1 and ensures that expressions like the matrix inverse in (13.2) make sense. Condition (i) is borrowed from the identical condition given in (11.10) and ensures that the limit in (13.2) exists. Condition (ii) gives convergence.

Assumption 13.1.2 permits dependence between current shocks and future regressors. This is desirable in a time series setting, since current shocks usually feed into future state variables.

One consequence of assumption 13.1.2 is that

E [usut ∣ x1,…,xt]={σ2ifs=t0    ifs<t\EE[ u_s u_t \given \boldx_1, \ldots,\boldx_t] = \begin{cases} & \sigma^2 \quad \text{if} \quad s = t \\ & 0 \quad \;\; \text{if} \quad s < t \end{cases}

The proof is an exercise (ex. 13.4.4).

A useful implication of assumptions 13.1.1 and 13.1.2 is that linear functions of {xtut}\{\boldx_t u_t\} form a martingale difference sequence (MDS). This will allow us to apply the sample path results in theorem 7.3.1.

13.1.2Consistency

Under the conditions of Section 13.1.1, the OLS estimator β^T\hboldbeta_T is consistent for β\boldbeta:

13.1.2.1Consistency of σ^T2\hat \sigma^2_T

In (12.5) we estimated the error variance σ2\sigma^2 using σ^2:=RSS/(N−K)\hat \sigma^2 := \rss / (N - K), with NN being the sample size. Here the sample size is TT, and since TT is assumed to be large relative to KK, we have 1/(T−K)≈1/T1/(T-K) \approx 1/T. Hence in this chapter we set σ^T2=RSS/T\hat \sigma^2_T = \rss / T instead. (None of the following theory is affected if we use RSS/(T−K)\rss / (T-K), however.)

13.1.3Asymptotic Normality of β^\hboldbeta

Next we show that T(β^T−β)\sqrt{T} (\hboldbeta_T - \boldbeta) is asymptotically normal. From this information we can develop asymptotic tests and confidence intervals.

13.1.4Large Sample Tests

In Section 12.1.4.1 we considered the problem of testing a hypothesis about an individual coefficient βk\beta_k. Let’s consider this problem again in the large sample setting. The hypothesis to be tested is

H0 ⁣:βk=βk0H_0 \colon \beta_k = \beta_k^0

In Section 12.1.4.1 we showed that if the error terms are normally distributed, then the expression (β^k−βk)/se⁡(β^k)(\hat \beta_k - \beta_k) / \se(\hat \beta_k) is tt-distributed with N−KN-K degrees of freedom. In the large sample case, we can use the CLT to show that the same statistic is asymptotically normal.[1] The next theorem gives details.

In the theorem, σ^T\hat \sigma_T is as defined in (13.8) and vk(X)v_k (\boldX) is the (k,k)(k,k)th element of (X⊺X)−1(\boldX^\T \boldX)^{-1}.

13.2MLE for Markov Processes

Let’s now turn to nonlinear estimation in a time series setting, using maximum likelihood. We will cover just the foundations of building and maximizing the likelihood.

13.2.1The Likelihood Function

If we have IID observations from some common density, then, as we saw in Section 8.3.1, the likelihood function for that data is the product of the marginals evaluated at the sample. If, instead, the data contains dependence, the likelihood is more complex.

One intermediate case is Markov processes, the joint distribution of which was given in (7.17). Suppose that the transition density pθp_{\boldtheta} depends on some unknown parameter vector θ∈Θ\boldtheta \in \Theta. Suppose further that the process has a unique stationary density π∞θ\pi_{\infty}^{\boldtheta} for all θ\boldtheta, and that x1\boldx_1 is a draw from this stationary density. Then the log-likelihood function is given by

ℓ(θ)=ln⁡π∞θ(x1)+∑t=1T−1ln⁡pθ(xt+1 ∣ xt)\ell(\boldtheta) = \ln \pi_{\infty}^{\boldtheta}(\boldx_1) + \sum_{t=1}^{T-1} \ln p_{\boldtheta}(\boldx_{t+1} \given \boldx_t)

In practice, it is usual to drop the first term in this expression, particularly when the data size is large, since the influence of a single element is likely to be negligible. In addition, even though the stationary density is formally defined by (7.19), for many processes, there is no known analytical expression for this density.[2] Here we’ll follow this convention and, abusing notation slightly, write

ℓ(θ)=∑t=1T−1ln⁡pθ(xt+1 ∣ xt)\ell(\boldtheta) = \sum_{t=1}^{T-1} \ln p_{\boldtheta}(\boldx_{t+1} \given \boldx_t)

13.2.1.1Example: The ARCH Case

Let’s look at a relatively simple case: the ARCH model from (7.5). By (13.17), the log-likelihood function is

ℓ(a,b)=∑t=1T−1{−12ln⁡(2π(a+bxt2))−xt+122(a+bxt2)}\ell(a, b) = \sum_{t=1}^{T-1} \left\{ - \frac{1}{2} \ln(2 \pi (a + b x_t^2)) - \frac{x_{t+1}^2}{2(a + b x_t^2)} \right\}

Rearranging, dropping terms that don’t depend on aa or bb, and multiplying by 2 (an increasing transformation), we can rewrite this (abusing notation again) as

ℓ(a,b)=−∑t=1T−1{ln⁡zt+xt+12zt}wherezt:=a+bxt2\ell(a, b) = - \sum_{t=1}^{T-1} \left\{ \ln z_t + \frac{x_{t+1}^2}{z_t} \right\} \quad \text{where} \quad z_t := a + b x_t^2

Let’s run some simulations to see what this function looks like. In the simulations we will set T=500T=500 and a=b=0.5a=b=0.5. Thus, we imagine the situation where, unbeknown to us, the true parameter values are a=b=0.5a=b=0.5, and we observe a time series x1,…,x500x_1,\ldots,x_{500} generated by these parameters. In order to estimate aa and bb, we form the likelihood function (13.19), and obtain the MLEs a^\hat a and b^\hat b as the vector (a^,b^)(\hat a, \hat b) that maximizes ℓ(a,b)\ell(a,b).

Four different simulations of ℓ\ell are given in figure 13.1. In each figure, a separate data set x1,…,x500x_1,\ldots,x_{500} is generated using the true parameter values a=b=0.5a=b=0.5 and the function ℓ\ell in (13.19) is then plotted using contour lines and a color map. Lighter colors refer to larger values. The horizontal axis is aa values, and the vertical axis is bb values. The code for producing one of these figures (modulo randomness) is given in listing 11. The function arch_like(theta, data) represents ℓ\ell in (13.19), with theta corresponding to (a,b)(a,b) and data corresponding to the time series x1,…,xTx_1,\ldots,x_T.

In each of the four simulations, a rough guess of the MLEs can be obtained just by looking for maximizers in the figures. For example, in simulation (a), the MLEs look to be around a^=0.44\hat a = 0.44 and b^=0.61\hat b = 0.61. To get more accurate estimates, we can use some form of analytical or numerical optimization. For this problem we don’t have any analytical expressions for the MLEs because setting the two partial derivatives of ℓ\ell in (13.19) to zero does not yield neat expressions for a^\hat a and b^\hat b. However, there are many numerical routines we can use to obtain the MLEs for a given data set.

The simplest approach is to use one of R’s inbuilt optimization routines. For example, given the definition of arch_like in listing 11 and a sequence of observations x1,…,xTx_1,\ldots,x_T stored in a vector xdata, the function arch_like can be optimized numerically via the commands

start_theta <- c(0.65, 0.35)  # An initial guess of (a,b)
neg_like <- function(theta) {
    return(-arch_like(theta, xdata))  # xdata is the data
}
opt <- optim(start_theta, neg_like, method="BFGS")

Here optim is an built-in R function for numerical optimization of multivariate functions. Most built-in functions perform minimization rather than maximization and optim is no exception. For this reason the function that we pass to optim is neg_like, which is −1-1 times ℓ\ell. The first argument to optim is a vector of starting values (a guess of the MLEs). The last argument tells optim to use the BFGS routine, which is variation on the Newton–Raphson algorithm. The return value of optim is a list, and the approximate minimizing vector is one element of this list (called par).

In this particular setup, for most realizations of the data and starting values, you will find that the algorithm converges to a good approximation to the global optimizer. However, there’s no guarantee that it will. In case of problems, it’s useful to know how these kinds of algorithms work, and how to code up simple implementations on your own. The next section will get you started.

Simulations of the function  with T=500

Figure 13.1:Simulations of the function (13.19) with T=500T=500

arch_like <- function(theta, data) {
    Y <- data[-1]             #  All but first element
    X <- data[-length(data)]  #  All but last element
    Z <- theta[1] + theta[2] * X^2
    return(-sum(log(Z) + Y^2 / Z))
} 

sim_data <- function(a, b, n=500) {
    x <- numeric(n)
    x[1] = 0
    w = rnorm(n)
    for (t in 1:(n-1)) {
        x[t+1] = sqrt(a + b * x[t]^2) * w[t]
    }
    return(x)
}

xdata <- sim_data(0.5, 0.5)  #  True parameters

K <- 50
a <- seq(0.3, 0.8, length=K)
b <- seq(0.3, 0.8, length=K)
M <- matrix(nrow=K, ncol=K)
for (i in 1:K) {
    for (j in 1:K) {
        theta <- c(a[i], b[j])
        M[i,j] <- arch_like(theta, xdata)
    }
}
image(a, b, M, col=topo.colors(12))
contour(a, b, M, nlevels=40, add=T)

Listing 11:Code for figure 

f-arch_plot
(R)

13.2.2The Newton–Raphson Algorithm

The Newton–Raphson algorithm is a root-finding algorithm. In other words, given a function g ⁣:R→Rg \colon \RR \to \RR, the algorithm searches for points sˉ∈R\bar s \in \RR such that g(sˉ)=0g(\bar s) = 0. Any root-finding algorithm can be used to optimize differentiable functions because, for differentiable functions, interior optimizers are always roots of the objective function’s first derivative.

To describe the algorithm, let’s begin with the root-finding problem and then specialize to optimization. To begin, let g ⁣:R→Rg \colon \RR \to \RR, and let s0s_0 be some initial point in R\RR that we think (hope) is somewhere near a root. We don’t know how to jump from s0s_0 straight to a root of gg (otherwise, there would be no problem to solve), but what we can do is move to the root of the function that forms the tangent line to gg at s0s_0. In other words, we replace gg with its linear approximation around s0s_0, which is given by

g~(s):=g(s0)+g′(s0)(s−s0)(s∈R)\tilde g(s) := g(s_0) + g'(s_0)(s - s_0) \qquad (s \in \RR)

and solve for the root of g~\tilde g. This point is represented as s1s_1 in figure 13.2, and the value is easily seen to be s1:=s0−g(s0)/g′(s0)s_1 := s_0 - g(s_0)/g'(s_0). The point s1s_1 is taken as our next guess of the root, and the procedure is repeated, taking the tangent of gg at s1s_1, solving for the root, and so on. This generates a sequence of points {sk}\{s_k\} satisfying

sk+1=sk−g(sk)g′(sk)s_{k+1} = s_k - \frac{g(s_k)}{g'(s_k)}

There are various results telling us that when gg is suitably well-behaved and s0s_0 is sufficiently close to a given root sˉ\bar s, then sequence {sk}\{s_k\} will converge to sˉ\bar s.[3]

First step of the Newton–Raphson algorithm

Figure 13.2:First step of the Newton–Raphson algorithm

To move from general root-finding to the specific problem of optimization, suppose now that g ⁣:R→Rg \colon \RR \to \RR is a twice differentiable function we wish to maximize. We know that if s∗s^* is a maximizer of gg, then g′(s∗)=0g'(s^*) = 0. Hence it is natural to begin our search for maximizers by looking for roots to this equation. This can be done by applying the Newton–Raphson algorithm to g′g', which yields the sequence

sk+1=sk−g′(sk)g′′(sk)s_{k+1} = s_k - \frac{g'(s_k)}{g''(s_k)}

We can extend this algorithm to the multivariate case as well. Let’s suppose that gg is a function of two arguments. In particular, suppose that gg is twice differentiable and g ⁣:R2→Rg \colon \RR^2 \to \RR. The gradient vector and Hessian of gg at (x,y)∈R2(x,y) \in \RR^2 are defined as

∇g(x,y):=(g1′(x,y)g2′(x,y))and∇2g(x,y):=(g11′′(x,y)g12′′(x,y)g21′′(x,y)g22′′(x,y))\nabla g(x,y) := \left( \begin{array}{c} g'_1 (x,y) \\ g'_2 (x,y) \end{array} \right) \quad \text{and} \quad \nabla^2 g(x,y) := \left( \begin{array}{cc} g''_{11} (x,y) & g''_{12} (x,y) \\ g''_{21} (x,y) & g''_{22} (x,y) \end{array} \right)

Here gi′g'_i is the first partial of gg with respect to its iith argument, gij′′g''_{ij} is the second cross-partial, and so on.

By analogy with (13.20), the Newton–Raphson algorithm for this two dimensional case is the algorithm that generates the sequence {(xk,yk)}\{(x_k, y_k)\} defined by

(xk+1,yk+1)=(xk,yk)−[∇2g(xk,yk)]−1∇g(xk,yk)(x_{k+1}, y_{k+1}) = (x_k, y_k) - [\nabla^2 g(x_k, y_k)]^{-1} \nabla g(x_k, y_k)

from some initial guess (x0,y0)(x_0, y_0).[4]

For the sake of the exercise, let’s apply this to maximization of (13.19). Let ztz_t be as defined in (13.19). The first partials are then

∂ℓ∂a(a,b)=∑t=1T−1[xt+12zt2−1zt],∂ℓ∂b(a,b)=∑t=1T−1xt2[xt+12zt2−1zt]\frac{\partial \ell}{\partial a} (a,b) = \sum_{t=1}^{T-1} \left[ \frac{x_{t+1}^2}{z_t^2} - \frac{1}{z_t} \right], \quad \frac{\partial \ell}{\partial b} (a,b) = \sum_{t=1}^{T-1} x_t^2 \left[ \frac{x_{t+1}^2}{z_t^2} - \frac{1}{z_t} \right]

while the second partials are

∂2ℓ∂a2(a,b)=∑t=1T−1[1zt2−2xt+12zt3],∂2ℓ∂b2(a,b)=∑t=1T−1xt4[1zt2−2xt+12zt3]\frac{\partial^2 \ell}{\partial a^2} (a,b) = \sum_{t=1}^{T-1} \left[ \frac{1}{z_t^2} - 2 \frac{x_{t+1}^2}{z_t^3} \right], \quad \frac{\partial^2 \ell}{\partial b^2} (a,b) = \sum_{t=1}^{T-1} x_t^4 \left[ \frac{1}{z_t^2} - 2 \frac{x_{t+1}^2}{z_t^3} \right]

The cross-partial is

∂2ℓ∂a∂b(a,b)=∑t=1T−1xt2[1zt2−2xt+12zt3]\frac{\partial^2 \ell}{\partial a \partial b} (a,b) = \sum_{t=1}^{T-1} x_t^2 \left[ \frac{1}{z_t^2} - 2 \frac{x_{t+1}^2}{z_t^3} \right]

From these expressions we can form the gradient vector and the Hessian, pick an initial guess, and iterate according to (13.21). Figure 13.3 shows four iterations of this procedure, starting from (a0,b0)=(0.65,0.35)(a_0, b_0) = (0.65, 0.35).[5] In this case the convergence is quick, and we are already close to the global optimum.

Replication of this figure (modulo randomness) is left as an exercise.

Newton–Raphson iterates

Figure 13.3:Newton–Raphson iterates

13.3Further Reading

Suitable topics for study after reading this chapter include GARCH models, hidden Markov models, Markov switching models, stochastic volatility models, factor models, and cointegration. High-quality textbook treatments of these and other topics in time series econometrics include Martin et al. (2012) and Hamilton (1994). Useful chapters on time series econometrics can be found in Hansen (2015) and Hayashi (2000). For a recent survey, see Diebold et al. (2009). For financial applications, see, for example, Ruppert (2011).

13.4Exercises

Incidentally, (13.23) can be used to test the null hypothesis that θ=θ0\boldtheta = \boldtheta_0. Under the null hypothesis, we have

T∥D^T(θ^T−θ0)∥2→dχ2(K)T \| \hat \boldD_T (\hat \boldtheta_T - \boldtheta_0) \|^2 \tod \chi^2(K)

Fixing α\alpha and letting cc be the 1−α1-\alpha quantile of the χ2(K)\chi^2(K) distribution, we reject the null if T∥D^T(θ^T−θ0)∥2>cT \| \hat \boldD_T (\hat \boldtheta_T - \boldtheta_0) \|^2 > c. This test is asymptotically of size α\alpha.

13.4.1Solutions to Selected Exercises

Footnotes
  1. This isn’t surprising because the tt-distribution converges to the standard normal distribution as the degrees of freedom converges to infinity. However, we can’t use this result directly because our model assumptions are different.

  2. It is still possible to compute the density numerically. See, for example, Stachurski & Martin (2008).

  3. In practical situations we often have no way of knowing whether the conditions are satisfied, and there have been many attempts to make the procedure more robust. The R optimization routine described above is a child of this process.

  4. We are assuming that the Hessian matrix is nonsingular.

  5. As before, the simulation uses a=b=0.5a = b = 0.5 and T=500T=500.

References
  1. Martin, V., Hurn, S., & Harris, D. (2012). Econometric Modelling with Time Series: Specification, Estimation and Testing. Cambridge, UK: Cambridge University Press.
  2. Hamilton, J. D. (1994). Time Series Analysis. Princeton: Princeton University Press.
  3. Hansen, B. E. (2015). Econometrics. Textbook in preparation. http://www.ssc.wisc%20edu/~bhansen/econometrics
  4. Hayashi, F. (2000). Econometrics. Princeton: Princeton University Press.
  5. Diebold, F. X., Kilian, L., & Nerlove, M. (2009). Time series analysis. In L. E. Blume & S. N. Durlauf (Eds.), The New Palgrave Dictionary of Economics. Palgrave Macmillan.
  6. Ruppert, D. (2011). Statistics and Data Analysis for Financial Engineering. Springer.
  7. Stachurski, J., & Martin, V. (2008). Computing the distributions of economic models via simulation. Econometrica, 76(2), 443–450.