CSPATIALREG Procedure

Conditional Autoregressive Models

Let y Subscript i denote the observation that is associated with a spatial unit bold s Subscript i for i equals 1 comma 2 comma ellipsis comma n, and let bold x Subscript i be a p times 1 vector that denotes values of p regressors recorded at unit bold s Subscript i.

The conditional autoregressive (CAR) model is defined by the set of full conditional distributions as

y Subscript i Baseline vertical-bar bold upper Y Subscript left-parenthesis i right-parenthesis Baseline tilde upper N left-parenthesis bold x prime Subscript i Baseline bold-italic beta plus sigma-summation Underscript j equals 1 Overscript n Endscripts upper C Subscript i j Baseline left-parenthesis y Subscript j Baseline minus bold x prime Subscript j Baseline bold-italic beta right-parenthesis comma sigma Subscript i Superscript 2 Baseline right-parenthesis

where bold upper Y Subscript left-parenthesis i right-parenthesis Baseline equals left-parenthesis y 1 comma y 2 comma ellipsis comma y Subscript i minus 1 Baseline comma y Subscript i plus 1 Baseline comma ellipsis comma y Subscript n Baseline right-parenthesis prime and bold upper C is an n times n matrix whose left-parenthesis i comma j right-parenthesisth element is upper C Subscript i j.

Denote bold upper M equals normal d normal i normal a normal g normal o normal n normal a normal l left-parenthesis sigma 1 squared comma sigma 2 squared comma ellipsis comma sigma Subscript n Superscript 2 Baseline right-parenthesis. Under the conditions that bold upper M Superscript negative 1 Baseline bold upper C is symmetric and bold upper M Superscript negative 1 Baseline left-parenthesis bold upper I Subscript n Baseline minus bold upper C right-parenthesis is positive definite, the joint distribution of bold y is well defined as

bold y tilde upper N left-parenthesis bold upper X bold-italic beta comma bold upper Sigma right-parenthesis

where bold upper X is an n times p matrix in which each row consists of bold x prime Subscript i and bold upper Sigma equals left-parenthesis bold upper I Subscript n Baseline minus bold upper C right-parenthesis Superscript negative 1 Baseline bold upper M.

The log-likelihood function for the CAR model takes the form

script upper L equals minus StartFraction n Over 2 EndFraction ln 2 pi minus one half ln StartAbsoluteValue bold upper Sigma EndAbsoluteValue minus StartFraction left-parenthesis bold y minus bold upper X bold-italic beta right-parenthesis prime bold upper Sigma Superscript negative 1 Baseline left-parenthesis bold y minus bold upper X bold-italic beta right-parenthesis Over 2 EndFraction

Often, it is considered that bold upper C equals rho bold upper W, where bold upper W is a spatial weights matrix, and

bold upper Sigma equals StartLayout Enlarged left-brace 1st Row 1st Column sigma squared left-parenthesis bold upper I Subscript n Baseline minus rho bold upper W right-parenthesis Superscript negative 1 Baseline 2nd Column if bold upper W is symmetric 2nd Row 1st Column sigma squared left-parenthesis bold upper D minus rho bold upper W right-parenthesis Superscript negative 1 Baseline 2nd Column if a symmetric bold upper W is row hyphen standardized EndLayout

where bold upper D equals normal d normal i normal a normal g normal o normal n normal a normal l left-parenthesis bold upper W Subscript 1 plus Baseline comma bold upper W Subscript 2 plus Baseline comma ellipsis comma bold upper W Subscript n plus Baseline right-parenthesis, in which bold upper W Subscript i plus is the sum of entries in the ith row of the bold upper W matrix for i equals 1 comma 2 comma ellipsis comma n.

Let bold upper D Superscript dagger be defined as

bold upper D Superscript dagger Baseline equals StartLayout Enlarged left-brace 1st Row 1st Column bold upper I Subscript n Baseline 2nd Column if a symmetric bold upper W is used 2nd Row 1st Column bold upper D 2nd Column if the row hyphen standardized version of a symmetric bold upper W is used EndLayout

The gradients for the CAR model can be derived as

StartFraction partial-differential script upper L Over partial-differential bold-italic beta EndFraction equals StartFraction bold upper X prime bold upper D Superscript dagger Baseline left-parenthesis bold upper I minus rho bold upper W right-parenthesis left-parenthesis bold y minus bold upper X bold-italic beta right-parenthesis Over sigma squared EndFraction
StartFraction partial-differential script upper L Over partial-differential rho EndFraction equals minus one half normal t normal r left-parenthesis bold upper A Superscript negative 1 Baseline bold upper W right-parenthesis plus StartFraction left-parenthesis bold y minus bold upper X bold-italic beta right-parenthesis prime bold upper D Superscript dagger Baseline bold upper W left-parenthesis bold y minus bold upper X bold-italic beta right-parenthesis Over 2 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 bold-italic beta right-parenthesis prime bold upper D Superscript dagger Baseline left-parenthesis bold upper I Subscript n Baseline minus rho bold upper W right-parenthesis left-parenthesis bold y minus bold upper X bold-italic beta right-parenthesis Over 2 left-parenthesis sigma squared right-parenthesis squared EndFraction

where bold upper A equals bold upper I Subscript n Baseline minus rho bold upper W.

Last updated: July 09, 2026