The SPATIALREG Procedure
Example 32.5 Taylor and Chebyshev Approximations
(View the complete code for this example.)
When you have a large data set (that is, the number of spatial units in your data is large), it becomes burdensome to fit some models. This is partially because all models except linear regression models involve the calculation of the determinant of the matrix of a large size (such as in a SAR model). In these cases, Taylor and Chebyshev approximations in PROC SPATIALREG can be helpful. The SPATIALREG procedure enables you to estimate both SAR and SDM models with a relatively large spatial weights matrix by using these two approximations. Using the two small data sets SIMDATA and SIMW in Models with Spatial ID Matching, you will see how you can invoke the two approximations in PROC SPATIALREG.
The following statements fit a SAR model by using Chebyshev approximation:
proc spatialreg data=simdata Wmat=simw approximation=(ORDER=10); model y=x1-x3 / type=SAR; spatialid SID; run;
The parameter estimates for this model are shown in Output 32.5.1. Note that the spatial weights matrix in the SIMW data set is a full matrix. Compared with Output 32.2.2, Chebyshev approximation yields very similar parameter estimates.
Output 32.5.1: Parameter Estimates of SAR Model with Chebyshev Approximation
| Parameter Estimates | |||||
|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standard Error | t Value | Approx Pr > |t| |
| Intercept | 1 | 1.780638 | 0.098699 | 18.04 | <.0001 |
| x1 | 1 | 0.573329 | 0.047395 | 12.10 | <.0001 |
| x2 | 1 | 0.707050 | 0.057181 | 12.37 | <.0001 |
| x3 | 1 | -0.902843 | 0.053314 | -16.93 | <.0001 |
| _rho | 1 | -0.473704 | 0.063004 | -7.52 | <.0001 |
| _sigma2 | 1 | 0.131509 | 0.026350 | 4.99 | <.0001 |
Using the compact representation of the spatial weights matrix, you can submit the following statements to fit a SAR model by using Chebyshev approximation:
proc spatialreg data=simdata Wmat=simw_compact approximation=(ORDER=10); model y=x1-x3 / type=SAR; spatialid SID; run;
The parameter estimates for this model are shown in Output 32.5.2, which is identical to Output 32.5.1.
Output 32.5.2: Parameter Estimates of SAR Model with Chebyshev Approximation and Compact Representation
| Parameter Estimates | |||||
|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standard Error | t Value | Approx Pr > |t| |
| Intercept | 1 | 1.780638 | 0.098699 | 18.04 | <.0001 |
| x1 | 1 | 0.573329 | 0.047395 | 12.10 | <.0001 |
| x2 | 1 | 0.707050 | 0.057181 | 12.37 | <.0001 |
| x3 | 1 | -0.902843 | 0.053314 | -16.93 | <.0001 |
| _rho | 1 | -0.473704 | 0.063004 | -7.52 | <.0001 |
| _sigma2 | 1 | 0.131509 | 0.026350 | 4.99 | <.0001 |
The following statements fit an SDM model by using Taylor approximation:
proc spatialreg data=simdata Wmat=simw approximation=(Taylor ORDER=50); model y=x1-x3/ type=SAR; spatialeffects x1-x3; spatialid SID; run;
The parameter estimates for this model are shown in Output 32.5.3. Compared with Output 32.2.3, the SDM model that is fit using Taylor approximation yields almost identical parameter estimates.
Output 32.5.3: Parameter Estimates of SDM Model with Taylor Approximation
| Parameter Estimates | |||||
|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standard Error | t Value | Approx Pr > |t| |
| Intercept | 1 | 1.932575 | 0.198882 | 9.72 | <.0001 |
| x1 | 1 | 0.548505 | 0.049806 | 11.01 | <.0001 |
| x2 | 1 | 0.686012 | 0.056266 | 12.19 | <.0001 |
| x3 | 1 | -0.890162 | 0.053516 | -16.63 | <.0001 |
| W_x1 | 1 | 0.172300 | 0.154018 | 1.12 | 0.2633 |
| W_x2 | 1 | 0.023744 | 0.198557 | 0.12 | 0.9048 |
| W_x3 | 1 | -0.324806 | 0.228032 | -1.42 | 0.1543 |
| _rho | 1 | -0.639755 | 0.164652 | -3.89 | 0.0001 |
| _sigma2 | 1 | 0.120527 | 0.024729 | 4.87 | <.0001 |
With the compact representation, the following statements fit the SDM model by using Taylor approximation:
proc spatialreg data=simdata Wmat=simw_compact
approximation=(Taylor ORDER=50);
model y=x1-x3/ type=SAR;
spatialeffects x1-x3;
spatialid SID;
run;
The parameter estimates for this model are shown in Output 32.5.4, which is identical to Output 32.5.3.
Output 32.5.4: Parameter Estimates of SDM Model with Taylor Approximation and Compact Representation
| Parameter Estimates | |||||
|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standard Error | t Value | Approx Pr > |t| |
| Intercept | 1 | 1.932575 | 0.198882 | 9.72 | <.0001 |
| x1 | 1 | 0.548505 | 0.049806 | 11.01 | <.0001 |
| x2 | 1 | 0.686012 | 0.056266 | 12.19 | <.0001 |
| x3 | 1 | -0.890162 | 0.053516 | -16.63 | <.0001 |
| W_x1 | 1 | 0.172300 | 0.154018 | 1.12 | 0.2633 |
| W_x2 | 1 | 0.023744 | 0.198557 | 0.12 | 0.9048 |
| W_x3 | 1 | -0.324806 | 0.228032 | -1.42 | 0.1543 |
| _rho | 1 | -0.639755 | 0.164652 | -3.89 | 0.0001 |
| _sigma2 | 1 | 0.120527 | 0.024729 | 4.87 | <.0001 |
To use Chebyshev approximation for the preceding SDM model, submit the following statements:
proc spatialreg data=simdata Wmat=simw approximation=(ORDER=10); model y=x1-x3/ type=SAR; spatialeffects x1-x3; spatialid SID; run;
The parameter estimates for this model are shown in Output 32.5.5, which is similar to Output 32.5.3.
Output 32.5.5: Parameter Estimates of SDM Model with Chebyshev Approximation
| Parameter Estimates | |||||
|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standard Error | t Value | Approx Pr > |t| |
| Intercept | 1 | 1.932081 | 0.198494 | 9.73 | <.0001 |
| x1 | 1 | 0.548538 | 0.049802 | 11.01 | <.0001 |
| x2 | 1 | 0.686049 | 0.056262 | 12.19 | <.0001 |
| x3 | 1 | -0.890191 | 0.053515 | -16.63 | <.0001 |
| W_x1 | 1 | 0.172017 | 0.153857 | 1.12 | 0.2636 |
| W_x2 | 1 | 0.023362 | 0.198331 | 0.12 | 0.9062 |
| W_x3 | 1 | -0.324342 | 0.227739 | -1.42 | 0.1544 |
| _rho | 1 | -0.639325 | 0.164295 | -3.89 | <.0001 |
| _sigma2 | 1 | 0.120542 | 0.024731 | 4.87 | <.0001 |
To use Chebyshev approximation for this model with compact representation, submit the following statements:
proc spatialreg data=simdata Wmat=simw_compact approximation=(ORDER=10); model y=x1-x3/ type=SAR; spatialeffects x1-x3; spatialid SID; run;
The parameter estimates for this model are shown in Output 32.5.6.
Output 32.5.6: Parameter Estimates of SDM Model with Chebyshev Approximation and Compact Representation
| Parameter Estimates | |||||
|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standard Error | t Value | Approx Pr > |t| |
| Intercept | 1 | 1.932081 | 0.198494 | 9.73 | <.0001 |
| x1 | 1 | 0.548538 | 0.049802 | 11.01 | <.0001 |
| x2 | 1 | 0.686049 | 0.056262 | 12.19 | <.0001 |
| x3 | 1 | -0.890191 | 0.053515 | -16.63 | <.0001 |
| W_x1 | 1 | 0.172017 | 0.153857 | 1.12 | 0.2636 |
| W_x2 | 1 | 0.023362 | 0.198331 | 0.12 | 0.9062 |
| W_x3 | 1 | -0.324342 | 0.227739 | -1.42 | 0.1544 |
| _rho | 1 | -0.639325 | 0.164295 | -3.89 | <.0001 |
| _sigma2 | 1 | 0.120542 | 0.024731 | 4.87 | <.0001 |