CSPATIALREG Procedure
Example 13.4 Taylor and Chebyshev Approximations
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 partly because all models except linear regression models require you to calculate the determinant of the matrix of a large size (such as in a spatial autoregressive model). In these cases, using Taylor and Chebyshev approximations in the CSPATIALREG procedure can be helpful. PROC CSPATIALREG enables you to estimate spatial autoregressive, spatial Durbin, spatial error, and spatial Durbin error models that have a relatively large spatial weights matrix by using these two approximations. By using the two small data sets
SimData and SimW from Simulated Data Example, examples in this section show how you can invoke the two approximations in PROC CSPATIALREG.
The following statements fit a spatial autoregressive (SAR) model by using Chebyshev approximation:
/*-- SAR Model : full W --*/
proc cspatialreg data=mylib.SimData Wmat=mylib.SimW approximation=(ORDER=10);
model y=x1-x3 / type=SAR;
spatialid SID;
run;
You use the APPROXIMATION= option to specify which approximation technique to use. By default, Chebyshev approximation is used. The ORDER=10 option specifies a 10th-order Chebyshev polynomial to be used for approximation. The parameter estimates for this model are shown in Output 13.4.1. Note that the spatial weights matrix in the SimW data set is a full matrix. Compared with Output 13.2.2, Chebyshev approximation yields very similar parameter estimates.
Output 13.4.1: Parameter Estimates of SAR Model with Chebyshev Approximation
| Parameter Estimates | |||||
|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standard Error | t Value | Approx Pr > |t| |
| Intercept | 1 | 1.780650 | 0.098703 | 18.04 | <.0001 |
| x1 | 1 | 0.573329 | 0.047395 | 12.10 | <.0001 |
| x2 | 1 | 0.707048 | 0.057181 | 12.37 | <.0001 |
| x3 | 1 | -0.902843 | 0.053314 | -16.93 | <.0001 |
| _rho | 1 | -0.473713 | 0.063008 | -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:
/*-- SAR Model : compact form of W --*/
proc cspatialreg data=mylib.SimData Wmat=mylib.SimW_Compact approximation=(ORDER=10);
model y=x1-x3 / type=SAR;
spatialid SID;
run;
The parameter estimates for this model are shown in Output 13.4.2, which is identical to Output 13.4.1.
Output 13.4.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.780650 | 0.098703 | 18.04 | <.0001 |
| x1 | 1 | 0.573329 | 0.047395 | 12.10 | <.0001 |
| x2 | 1 | 0.707048 | 0.057181 | 12.37 | <.0001 |
| x3 | 1 | -0.902843 | 0.053314 | -16.93 | <.0001 |
| _rho | 1 | -0.473713 | 0.063008 | -7.52 | <.0001 |
| _sigma2 | 1 | 0.131509 | 0.026350 | 4.99 | <.0001 |
The following statements fit a spatial Durbin model (SDM) by using Taylor approximation. You specify the keyword TAYLOR in the APPROXIMATION= option to request Taylor approximation. In particular, you request a 50th-order Taylor polynomial to be used for approximation by specifying the ORDER=50 option.
/*-- SDM : Taylor approximation with full W --*/
proc cspatialreg data=mylib.SimData Wmat=mylib.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 13.4.3. Compared with Output 13.2.3, the SDM that is fit using Taylor approximation yields almost identical parameter estimates.
Output 13.4.3: Parameter Estimates of SDM with Taylor Approximation
| Parameter Estimates | |||||
|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standard Error | t Value | Approx Pr > |t| |
| Intercept | 1 | 1.932578 | 0.198882 | 9.72 | <.0001 |
| x1 | 1 | 0.548504 | 0.049806 | 11.01 | <.0001 |
| x2 | 1 | 0.686011 | 0.056266 | 12.19 | <.0001 |
| x3 | 1 | -0.890161 | 0.053516 | -16.63 | <.0001 |
| W_x1 | 1 | 0.172302 | 0.154018 | 1.12 | 0.2633 |
| W_x2 | 1 | 0.023746 | 0.198557 | 0.12 | 0.9048 |
| W_x3 | 1 | -0.324808 | 0.228032 | -1.42 | 0.1543 |
| _rho | 1 | -0.639757 | 0.164651 | -3.89 | 0.0001 |
| _sigma2 | 1 | 0.120527 | 0.024729 | 4.87 | <.0001 |
With the compact representation, the following statements fit the SDM by using Taylor approximation:
/*-- SDM : Taylor approximation with compact W --*/
proc cspatialreg data=mylib.SimData Wmat=mylib.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 13.4.4, which is identical to Output 13.4.3.
Output 13.4.4: Parameter Estimates of SDM with Taylor Approximation and Compact Representation
| Parameter Estimates | |||||
|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standard Error | t Value | Approx Pr > |t| |
| Intercept | 1 | 1.932578 | 0.198882 | 9.72 | <.0001 |
| x1 | 1 | 0.548504 | 0.049806 | 11.01 | <.0001 |
| x2 | 1 | 0.686011 | 0.056266 | 12.19 | <.0001 |
| x3 | 1 | -0.890161 | 0.053516 | -16.63 | <.0001 |
| W_x1 | 1 | 0.172302 | 0.154018 | 1.12 | 0.2633 |
| W_x2 | 1 | 0.023746 | 0.198557 | 0.12 | 0.9048 |
| W_x3 | 1 | -0.324808 | 0.228032 | -1.42 | 0.1543 |
| _rho | 1 | -0.639757 | 0.164651 | -3.89 | 0.0001 |
| _sigma2 | 1 | 0.120527 | 0.024729 | 4.87 | <.0001 |
To use Chebyshev approximation for the preceding SDM, submit the following statements:
/*-- SDM : Chebyshev approximation with full W --*/
proc cspatialreg data=mylib.SimData Wmat=mylib.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 13.4.5, which is similar to Output 13.4.3.
Output 13.4.5: Parameter Estimates of SDM with Chebyshev Approximation
| Parameter Estimates | |||||
|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standard Error | t Value | Approx Pr > |t| |
| Intercept | 1 | 1.932574 | 0.198876 | 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.154015 | 1.12 | 0.2633 |
| W_x2 | 1 | 0.023744 | 0.198554 | 0.12 | 0.9048 |
| W_x3 | 1 | -0.324805 | 0.228027 | -1.42 | 0.1543 |
| _rho | 1 | -0.639755 | 0.164646 | -3.89 | 0.0001 |
| _sigma2 | 1 | 0.120527 | 0.024729 | 4.87 | <.0001 |
To use Chebyshev approximation for this model with compact representation, submit the following statements:
/*-- SDM : Chebyshev approximation with compact W --*/
proc cspatialreg data=mylib.SimData Wmat=mylib.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 13.4.6.
Output 13.4.6: Parameter Estimates of SDM with Chebyshev Approximation and Compact Representation
| Parameter Estimates | |||||
|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standard Error | t Value | Approx Pr > |t| |
| Intercept | 1 | 1.932574 | 0.198876 | 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.154015 | 1.12 | 0.2633 |
| W_x2 | 1 | 0.023744 | 0.198554 | 0.12 | 0.9048 |
| W_x3 | 1 | -0.324805 | 0.228027 | -1.42 | 0.1543 |
| _rho | 1 | -0.639755 | 0.164646 | -3.89 | 0.0001 |
| _sigma2 | 1 | 0.120527 | 0.024729 | 4.87 | <.0001 |
The following statements fit a spatial error model (SEM) by using Chebyshev approximation:
/*-- SEM : full W --*/
proc cspatialreg data=mylib.SimData Wmat=mylib.SimW approximation=(ORDER=10);
model y=x1-x3 / type=SEM;
spatialid SID;
run;
The parameter estimates for this model are shown in Output 13.4.7. Note that the spatial weights matrix in the mylib.SimW data table is a full matrix. Compared with Output 13.2.4, Chebyshev approximation yields similar parameter estimates.
Output 13.4.7: Parameter Estimates of SEM with Chebyshev Approximation
| Parameter Estimates | |||||
|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standard Error | t Value | Approx Pr > |t| |
| Intercept | 1 | 1.166221 | 0.029666 | 39.31 | <.0001 |
| x1 | 1 | 0.488222 | 0.049184 | 9.93 | <.0001 |
| x2 | 1 | 0.635419 | 0.061432 | 10.34 | <.0001 |
| x3 | 1 | -0.831401 | 0.054913 | -15.14 | <.0001 |
| _lambda | 1 | -0.957363 | 0.117021 | -8.18 | <.0001 |
| _sigma2 | 1 | 0.148034 | 0.031092 | 4.76 | <.0001 |
Using the compact representation of the spatial weights matrix, you can submit the following statements to fit an SEM by using Chebyshev approximation:
/*-- SEM : compact form of W --*/
proc cspatialreg data=mylib.SimData Wmat=mylib.SimW_Compact approximation=(ORDER=10);
model y=x1-x3 / type=SEM;
spatialid SID;
run;
The parameter estimates for this model are shown in Output 13.4.8, which is almost identical to Output 13.4.7.
Output 13.4.8: Parameter Estimates of SEM with Chebyshev Approximation and Compact Representation
| Parameter Estimates | |||||
|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standard Error | t Value | Approx Pr > |t| |
| Intercept | 1 | 1.166221 | 0.029666 | 39.31 | <.0001 |
| x1 | 1 | 0.488222 | 0.049184 | 9.93 | <.0001 |
| x2 | 1 | 0.635419 | 0.061432 | 10.34 | <.0001 |
| x3 | 1 | -0.831401 | 0.054913 | -15.14 | <.0001 |
| _lambda | 1 | -0.957363 | 0.117021 | -8.18 | <.0001 |
| _sigma2 | 1 | 0.148034 | 0.031092 | 4.76 | <.0001 |
The following statements fit a spatial Durbin error model (SDEM) by using Taylor approximation:
/*-- SDEM : Taylor approximation with full W --*/
proc cspatialreg data=mylib.SimData Wmat=mylib.SimW approximation=(Taylor ORDER=50);
model y=x1-x3/ type=SEM;
spatialeffects x1-x3;
spatialid SID;
run;
The parameter estimates for this model are shown in Output 13.4.9.
Output 13.4.9: Parameter Estimates of SDEM with Taylor Approximation
| Parameter Estimates | |||||
|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standard Error | t Value | Approx Pr > |t| |
| Intercept | 1 | 1.193178 | 0.047129 | 25.32 | <.0001 |
| x1 | 1 | 0.566497 | 0.056782 | 9.98 | <.0001 |
| x2 | 1 | 0.722060 | 0.059717 | 12.09 | <.0001 |
| x3 | 1 | -0.909212 | 0.061286 | -14.84 | <.0001 |
| W_x1 | 1 | -0.135284 | 0.128339 | -1.05 | 0.2918 |
| W_x2 | 1 | -0.418116 | 0.152899 | -2.73 | 0.0062 |
| W_x3 | 1 | 0.290041 | 0.192397 | 1.51 | 0.1317 |
| _lambda | 1 | -0.723853 | 0.209844 | -3.45 | 0.0006 |
| _sigma2 | 1 | 0.126723 | 0.026820 | 4.73 | <.0001 |
With the compact representation, the following statements fit the SDEM by using Taylor approximation:
/*-- SDEM : Taylor approximation with compact W --*/
proc cspatialreg data=mylib.SimData Wmat=mylib.SimW_Compact
approximation=(Taylor ORDER=50);
model y=x1-x3/ type=SEM;
spatialeffects x1-x3;
spatialid SID;
run;
The parameter estimates for this model are shown in Output 13.4.10, which is identical to Output 13.4.9.
Output 13.4.10: Parameter Estimates of SDEM with Taylor Approximation and Compact Representation
| Parameter Estimates | |||||
|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standard Error | t Value | Approx Pr > |t| |
| Intercept | 1 | 1.193178 | 0.047129 | 25.32 | <.0001 |
| x1 | 1 | 0.566497 | 0.056782 | 9.98 | <.0001 |
| x2 | 1 | 0.722060 | 0.059717 | 12.09 | <.0001 |
| x3 | 1 | -0.909212 | 0.061286 | -14.84 | <.0001 |
| W_x1 | 1 | -0.135284 | 0.128339 | -1.05 | 0.2918 |
| W_x2 | 1 | -0.418116 | 0.152899 | -2.73 | 0.0062 |
| W_x3 | 1 | 0.290041 | 0.192397 | 1.51 | 0.1317 |
| _lambda | 1 | -0.723853 | 0.209844 | -3.45 | 0.0006 |
| _sigma2 | 1 | 0.126723 | 0.026820 | 4.73 | <.0001 |
To use Chebyshev approximation to fit the preceding SDEM, submit the following statements:
/*-- SDEM : Chebyshev approximation with full W --*/
proc cspatialreg data=mylib.SimData Wmat=mylib.SimW approximation=(ORDER=10);
model y=x1-x3/ type=SEM;
spatialeffects x1-x3;
spatialid SID;
run;
The parameter estimates for this model are shown in Output 13.4.11, which is similar to Output 13.4.9.
Output 13.4.11: Parameter Estimates of SDEM with Chebyshev Approximation
| Parameter Estimates | |||||
|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standard Error | t Value | Approx Pr > |t| |
| Intercept | 1 | 1.193178 | 0.047129 | 25.32 | <.0001 |
| x1 | 1 | 0.566500 | 0.056780 | 9.98 | <.0001 |
| x2 | 1 | 0.722062 | 0.059716 | 12.09 | <.0001 |
| x3 | 1 | -0.909213 | 0.061285 | -14.84 | <.0001 |
| W_x1 | 1 | -0.135290 | 0.128335 | -1.05 | 0.2918 |
| W_x2 | 1 | -0.418122 | 0.152895 | -2.73 | 0.0062 |
| W_x3 | 1 | 0.290046 | 0.192393 | 1.51 | 0.1317 |
| _lambda | 1 | -0.723821 | 0.209774 | -3.45 | 0.0006 |
| _sigma2 | 1 | 0.126724 | 0.026819 | 4.73 | <.0001 |
To use Chebyshev approximation for this model with compact representation, submit the following statements:
/*-- SDEM : Chebyshev approximation with compact W --*/
proc cspatialreg data=mylib.SimData Wmat=mylib.SimW_Compact approximation=(ORDER=10);
model y=x1-x3/ type=SEM;
spatialeffects x1-x3;
spatialid SID;
run;
The parameter estimates for this model are shown in Output 13.4.12.
Output 13.4.12: Parameter Estimates of SDEM with Chebyshev Approximation and Compact Representation
| Parameter Estimates | |||||
|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standard Error | t Value | Approx Pr > |t| |
| Intercept | 1 | 1.193178 | 0.047129 | 25.32 | <.0001 |
| x1 | 1 | 0.566500 | 0.056780 | 9.98 | <.0001 |
| x2 | 1 | 0.722062 | 0.059716 | 12.09 | <.0001 |
| x3 | 1 | -0.909213 | 0.061285 | -14.84 | <.0001 |
| W_x1 | 1 | -0.135290 | 0.128335 | -1.05 | 0.2918 |
| W_x2 | 1 | -0.418122 | 0.152895 | -2.73 | 0.0062 |
| W_x3 | 1 | 0.290046 | 0.192393 | 1.51 | 0.1317 |
| _lambda | 1 | -0.723821 | 0.209774 | -3.45 | 0.0006 |
| _sigma2 | 1 | 0.126724 | 0.026819 | 4.73 | <.0001 |