CSPATIALREG Procedure

Spatial Lag of X Models

The spatial lag of X (SLX) model assumes no endogenous interaction effects or spatial dependence in the error terms. Instead, it incorporates only exogenous interaction effects into the linear regression model. Let y Subscript i denote the observation that is associated with the spatial unit bold s Subscript i for i equals 1 comma 2 comma ellipsis comma n. For these spatial units, let bold upper W be a spatial weights matrix. Further, let bold x Subscript i be a p times 1 vector that denotes values of p regressors recorded at unit bold s Subscript i, and let bold z Subscript i be a q times 1 vector that denotes values of q regressors measured at unit bold s Subscript i.

The SLX model can be described in vector form as

bold y equals bold upper X bold-italic beta plus bold upper W bold upper Z bold-italic theta plus bold-italic epsilon

where bold y equals left-parenthesis y 1 comma y 2 comma ellipsis comma y Subscript n Baseline right-parenthesis prime, bold-italic epsilon equals left-parenthesis epsilon 1 comma epsilon 2 comma ellipsis comma epsilon Subscript n Baseline right-parenthesis prime with epsilon Subscript i Baseline tilde Overscript normal i normal i normal d Endscripts upper N left-parenthesis 0 comma sigma squared right-parenthesis, bold upper X is an n times p matrix where each row consists of bold x prime Subscript i, bold upper Z is an n times q matrix where each row consists of bold z prime Subscript i, and bold-italic beta is a p times 1 parameter vector.

By letting upper X overTilde equals left-bracket bold upper X bold upper W bold upper Z right-bracket and bold-italic beta overTilde equals left-parenthesis bold-italic beta prime bold-italic theta Superscript prime Baseline right-parenthesis prime, you can rewrite the SLX model as

bold y equals bold upper X overTilde bold-italic beta overTilde plus bold-italic epsilon

The log-likelihood function for the SLX model is

script upper L equals minus StartFraction n Over 2 EndFraction ln left-parenthesis 2 pi sigma squared right-parenthesis minus StartFraction left-parenthesis bold y minus bold upper X overTilde bold-italic beta overTilde right-parenthesis prime left-parenthesis bold y minus bold upper X overTilde bold-italic beta overTilde right-parenthesis Over 2 sigma squared EndFraction

For the SLX model, the gradients are

StartFraction partial-differential script upper L Over partial-differential bold-italic beta overTilde EndFraction equals StartFraction left-parenthesis bold upper X overTilde right-parenthesis prime left-parenthesis bold y minus bold upper X overTilde bold-italic beta overTilde right-parenthesis Over sigma squared EndFraction
StartFraction partial-differential script upper L Over partial-differential sigma squared EndFraction equals minus StartFraction n Over 2 sigma squared EndFraction plus StartFraction left-parenthesis bold y minus bold upper X overTilde bold-italic beta overTilde right-parenthesis prime left-parenthesis bold y minus bold upper X overTilde bold-italic beta overTilde right-parenthesis Over 2 sigma Superscript 4 Baseline EndFraction

The Hessians take the following forms:

StartFraction partial-differential squared script upper L Over partial-differential bold-italic beta overTilde partial-differential bold-italic beta overTilde prime EndFraction equals minus StartFraction bold upper X overTilde prime bold upper X overTilde Over sigma squared EndFraction
StartFraction partial-differential squared script upper L Over partial-differential bold-italic beta overTilde partial-differential sigma squared EndFraction equals minus StartFraction bold upper X overTilde prime left-parenthesis bold y minus bold upper X overTilde bold-italic beta overTilde right-parenthesis Over sigma Superscript 4 Baseline EndFraction
StartFraction partial-differential squared script upper L Over partial-differential sigma Superscript 4 Baseline EndFraction equals StartFraction n Over 2 sigma Superscript 4 Baseline EndFraction minus StartFraction left-parenthesis bold y minus bold upper X overTilde bold-italic beta overTilde right-parenthesis prime left-parenthesis bold y minus bold upper X overTilde bold-italic beta overTilde right-parenthesis Over sigma Superscript 6 Baseline EndFraction
Last updated: July 09, 2026