SPATIALREG Procedure

Approximations to the Jacobian

In order for PROC SPATIALREG to obtain maximum likelihood estimates for all models except linear regression models, it needs to compute the Jacobian term because that term appears in the log-likelihood function. The Jacobian term is ln StartAbsoluteValue bold upper I Subscript n Baseline minus rho bold upper W EndAbsoluteValue for SDMs and SAR models and ln StartAbsoluteValue bold upper I Subscript n Baseline minus lamda bold upper W EndAbsoluteValue for SEMs and SDEMs, where n is the number of observations and bold upper W is the spatial weights matrix. When n is not large, the Jacobian is computed as

ln StartAbsoluteValue bold upper I Subscript n Baseline minus rho bold upper W EndAbsoluteValue equals sigma-summation Underscript i equals 1 Overscript n Endscripts ln StartAbsoluteValue 1 minus rho omega Subscript i Baseline EndAbsoluteValue

where omega Subscript i are the eigenvalues of bold upper W. This computation requires that all eigenvalues of bold upper W be precomputed, which works fine for small data sets. However, when n is large, computing the Jacobian term by using the eigenvalue method can be computationally infeasible. Instead, you can use approximations to the Jacobian.

The SPATIALREG procedure supports two different approximations to the Jacobian for SDMs, SEMs, SDEMs, and SAR models: Taylor approximation or Chebyshev approximation. Using SDMs and SAR models as an example, the two approximations for the Jacobian term can be described as follows (for more information, see LeSage and Pace 2009, and the references therein):

  • Taylor approximation uses finite, lower-order series to approximate the log-determinant as

    ln StartAbsoluteValue bold upper I Subscript n Baseline minus rho bold upper W EndAbsoluteValue almost-equals minus sigma-summation Underscript k equals 1 Overscript q Endscripts StartFraction rho Superscript k Baseline normal t normal r left-parenthesis bold upper W Superscript k Baseline right-parenthesis Over k EndFraction
  • Chebyshev approximation uses finite, lower-order Chebyshev polynomials of the first kind to approximate the log-determinant as

    ln StartAbsoluteValue bold upper I Subscript n Baseline minus rho bold upper W EndAbsoluteValue almost-equals sigma-summation Underscript k equals 0 Overscript q Endscripts c Subscript k Baseline left-parenthesis rho right-parenthesis normal t normal r left-parenthesis upper T Subscript k Baseline left-parenthesis bold upper W right-parenthesis right-parenthesis

    where upper T 0 left-parenthesis bold upper W right-parenthesis equals bold upper I Subscript n, upper T 1 left-parenthesis bold upper W right-parenthesis equals bold upper W, and upper T Subscript k plus 1 Baseline left-parenthesis bold upper W right-parenthesis equals 2 bold upper W upper T Subscript k Baseline left-parenthesis bold upper W right-parenthesis minus upper T Subscript k minus 1 Baseline left-parenthesis bold upper W right-parenthesis for k equals 1 comma 2 comma ellipsis comma q. The coefficients c Subscript k Baseline left-parenthesis rho right-parenthesis are defined as

    c Subscript k Baseline left-parenthesis rho right-parenthesis equals StartLayout Enlarged left-brace 1st Row 1st Column StartFraction 1 Over q plus 1 EndFraction sigma-summation Underscript j equals 0 Overscript q Endscripts ln left-parenthesis 1 minus rho cosine theta Subscript j Baseline right-parenthesis cosine left-parenthesis k theta Subscript j Baseline right-parenthesis 2nd Column if k equals 0 2nd Row 1st Column StartFraction 2 Over q plus 1 EndFraction sigma-summation Underscript j equals 0 Overscript q Endscripts ln left-parenthesis 1 minus rho cosine theta Subscript j Baseline right-parenthesis cosine left-parenthesis k theta Subscript j Baseline right-parenthesis 2nd Column if k greater-than 0 EndLayout

    with theta Subscript j Baseline equals left-parenthesis j plus 1 right-parenthesis pi slash left-parenthesis q plus 1 right-parenthesis for j equals 0 comma 1 comma ellipsis comma q.

The traces of powers of bold upper W can be computed exactly or approximated using Monte Carlo simulation. The Monte Carlo simulation is done as follows,

normal t normal r left-parenthesis bold upper W Superscript k Baseline right-parenthesis almost-equals StartFraction 1 Over upper M EndFraction sigma-summation Underscript l equals 1 Overscript upper M Endscripts StartFraction n Over bold u prime Subscript l Baseline bold u Subscript l Baseline EndFraction bold u prime Subscript l Baseline bold upper W Superscript k Baseline bold u Subscript l

where bold u Subscript l Baseline tilde Overscript normal i normal i normal d Endscripts upper N left-parenthesis bold 0 comma bold upper I Subscript n Baseline right-parenthesis and M is the total number of Monte Carlo samples.

When you apply these two approximations, it is often assumed that the maximum eigenvalue of bold upper W equals 1 and the minimum eigenvalue of bold upper W is greater than or equal to –1 (see LeSage and Pace 2009, and the references therein). One way to satisfy this assumption is to use a row-standardized spatial weights matrix that is similar to a symmetric matrix. If the spatial weights matrix is not symmetric or similar to a symmetric matrix, it becomes more difficult to apply Chebyshev approximation and thus requires extra care (LeSage and Pace 2009).

When you request an approximation to the Jacobian, the choices that you need to make might include the approximation method to use (that is, Taylor approximation or Chebyshev approximation); the order of series q; and the number of Monte Carlo samples (that is, M). Your choice can be accommodated through the APPROXIMATION= option in the PROC SPATIALREG statement. For the approximation method, you can use the keyword TAYLOR in the APPROXIMATION= option to request Taylor approximation. Otherwise, the approximation method defaults to Chebyshev approximation. You specify ORDER=q in the APPROXIMATION= option to request a series of order q when approximating the log-determinant. In addition, you specify NMC=M in the APPROXIMATION= option to request M Monte Carlo samples to be drawn when approximating the traces of powers of bold upper W. In addition, you can use the SEED= suboption of the APPROXIMATION= option to specify an integer seed for a random number generator to replicate your analysis.

Last updated: June 19, 2025