Skip to contents

Geographically Weighted Density Regression (GWDR)

Usage

gwdr(
  formula,
  data,
  config = list(gwdr_config()),
  optim_bw = c("no", "AIC", "CV"),
  optim_bw_threshold = 1e-06,
  optim_bw_step = 0.02,
  optim_bw_max_iter = 1e+06,
  parallel_method = c("no", "omp"),
  parallel_arg = c(0),
  verbose = FALSE
)

# S3 method for gwdrm
plot(x, y, ..., columns)

# S3 method for gwdrm
step(
  object,
  ...,
  criterion = c("AIC"),
  threshold = 3,
  config = list(gwdr_config()),
  optim_bw = c("no", "AIC", "CV"),
  optim_bw_threshold = 1e-06,
  optim_bw_step = 0.02,
  optim_bw_max_iter = 1e+06
)

# S3 method for gwdrm
coef(object, ...)

# S3 method for gwdrm
fitted(object, ...)

# S3 method for gwdrm
residuals(object, ...)

Arguments

formula

Regresison model.

data

A sf objects.

config

Dimension-specified weighting configuration. If it is omitted, bandwidth settings will be inherited from object. Otherwise, it must be a list of GWDRConfig objects. Its length can be 1 or equal to the number of columns of coordinates in data. When its length is 1, elements will be duplicated for each column in coordinates.

optim_bw

Whether optimize bandwidth after selecting models. Avaliable values are no, AIC, and CV. If no is specified, the bandwidth specified by argument bw is used in calibrating selected models.

optim_bw_threshold

Threshold of bandwidth optimization.

optim_bw_step

Step size in bandwidth optimization.

optim_bw_max_iter

Maximum of iteration in bandwidth optimization.

parallel_method

Parallel method.

parallel_arg

Parallel method argument.

verbose

Whether to print additional information. A higher value leads to more information.

x

A "gwdrm" object.

y

Ignored.

...

Additional arguments passing to residuals().

columns

Column names to plot. If it is missing or non-character value, all coefficient columns are plottd.

object

A "gwdrm" object.

criterion

The model-selection method. Currently there is only AIC available.

threshold

The threshold of criterion changes. Default to 3.0.

Value

A gwdrm object.

Functions

  • plot(gwdrm): Plot the result of GWDR model.

  • step(gwdrm): Model selection for GWDR model

  • coef(gwdrm): Get coefficients of a GWDR model.

  • fitted(gwdrm): Get fitted values of a GWDR model.

  • residuals(gwdrm): Get residuals of a GWDR model.

Examples

data(LondonHP)
gwdr(PURCHASE ~ FLOORSZ + UNEMPLOY, LondonHP)
#> Geographically Weighted Density Regression Model
#> ================================================
#>   Formula: PURCHASE ~ FLOORSZ + UNEMPLOY
#>      Data: LondonHP
#> Dimension-specified Weighting Configuration
#> -------------------------------------------
#>      bw unit   kernel
#> X 0.618    % gaussian
#> Y 0.618    % gaussian
#> 
#> 
#> Summary of Coefficient Estimates
#> --------------------------------
#>  Coefficient         Min.      1st Qu.       Median      3rd Qu.        Max. 
#>    Intercept    27014.316    36463.244    40517.121    45363.984   51831.617 
#>      FLOORSZ     1211.219     1289.332     1391.465     1514.730    1667.109 
#>     UNEMPLOY  -291434.012  -211149.409  -184611.571  -139450.943  -60323.935 
#> 
#> 
#> Diagnostic Information
#> ----------------------
#>   RSS: 747158563567
#>   ENP: 7.960377
#>   EDF: 308.0396
#>    R2: 0.5827805
#> R2adj: 0.5719635
#>   AIC: 7723.193
#>  AICc: 7731.494
#> 
#> 

### Specific Bandwidth
gwdr(PURCHASE ~ FLOORSZ + UNEMPLOY, LondonHP, list(
    gwdr_config(0.2, TRUE, "gaussian"),
    gwdr_config(0.2, TRUE, "gaussian")
))
#> Geographically Weighted Density Regression Model
#> ================================================
#>   Formula: PURCHASE ~ FLOORSZ + UNEMPLOY
#>      Data: LondonHP
#> Dimension-specified Weighting Configuration
#> -------------------------------------------
#>      bw unit   kernel
#> X 0.200    % gaussian
#> Y 0.200    % gaussian
#> 
#> 
#> Summary of Coefficient Estimates
#> --------------------------------
#>  Coefficient          Min.      1st Qu.       Median    3rd Qu.         Max. 
#>    Intercept    -96041.664     8968.096    29446.502  61180.002   141775.935 
#>      FLOORSZ       880.706     1115.388     1467.748   1841.159     2906.490 
#>     UNEMPLOY  -1283111.009  -658938.072  -330762.585  80702.591  1758139.969 
#> 
#> 
#> Diagnostic Information
#> ----------------------
#>   RSS: 330825058667
#>   ENP: 50.81191
#>   EDF: 265.1881
#>    R2: 0.8152645
#> R2adj: 0.7797339
#>   AIC: 7498.408
#>  AICc: 7550.682
#> 
#> 

### Optim Bandwidth
m <- gwdr(PURCHASE ~ FLOORSZ + UNEMPLOY + PROF, LondonHP, list(
    gwdr_config(0.618, TRUE, "gaussian")
), optim_bw = "AIC")
m
#> Geographically Weighted Density Regression Model
#> ================================================
#>   Formula: PURCHASE ~ FLOORSZ + UNEMPLOY + PROF
#>      Data: LondonHP
#> Dimension-specified Weighting Configuration
#> -------------------------------------------
#>      bw unit   kernel
#> X 0.152    % gaussian
#> Y 0.184    % gaussian
#> 
#> 
#> Summary of Coefficient Estimates
#> --------------------------------
#>  Coefficient          Min.      1st Qu.      Median      3rd Qu.         Max. 
#>    Intercept   -434508.150  -193547.561  -86068.243   -10234.694   231864.185 
#>      FLOORSZ       862.427     1060.284    1487.934     1919.448     3430.186 
#>     UNEMPLOY  -1814381.534  -193923.181  282071.922  1305474.310  4224035.331 
#>         PROF   -287881.575    93217.230  210504.919   314162.507   650395.558 
#> 
#> 
#> Diagnostic Information
#> ----------------------
#>   RSS: 221159462334
#>   ENP: 80.00537
#>   EDF: 235.9946
#>    R2: 0.8765027
#> R2adj: 0.8344573
#>   AIC: 7395.513
#>  AICc: 7493.572
#> 
#> 

plot(m)


step(m, threshold = 100.0)
#> Geographically Weighted Density Regression Model
#> ================================================
#>   Formula: PURCHASE ~ FLOORSZ + PROF
#>      Data: LondonHP
#> Dimension-specified Weighting Configuration
#> -------------------------------------------
#>      bw unit   kernel
#> X 0.152    % gaussian
#> Y 0.184    % gaussian
#> 
#> 
#> Summary of Coefficient Estimates
#> --------------------------------
#>  Coefficient          Min.      1st Qu.      Median     3rd Qu.         Max. 
#>    Intercept   -297578.851  -100469.306  -46437.065    2869.832  1201891.888 
#>      FLOORSZ       -88.849     1014.984    1439.167    1834.377     3630.360 
#>         PROF  -2642952.843    55962.929  146567.391  265430.109   634696.962 
#> 
#> 
#> Diagnostic Information
#> ----------------------
#>   RSS: 184522745816
#>   ENP: 94.88198
#>   EDF: 221.118
#>    R2: 0.896961
#> R2adj: 0.8525459
#>   AIC: 7352.316
#>  AICc: 7483.3
#> 
#> 

coef(m)
#>        Intercept   FLOORSZ     UNEMPLOY         PROF
#> 0    -10798.5873  968.7072  -234831.545  156060.9274
#> 1     -2350.6256  958.4276  -307396.205  146028.2609
#> 2    -25638.0344  994.7951  -149534.131  172781.6972
#> 3    -22746.4097  994.7217  -176604.522  168205.2525
#> 4     -2187.2843  963.2934  -341053.709  145779.4976
#> 5     95762.0527  906.6120  -969458.195    -374.2328
#> 6     97471.8467  901.4757 -1004457.234    -389.6849
#> 7     49598.4225  912.6737  -800978.992   81594.3990
#> 8    115305.7416  880.1942 -1187053.382  -20451.6297
#> 9     93412.7269  873.3421 -1146383.342   23822.9410
#> 10    93412.7269  873.3421 -1146383.342   23822.9410
#> 11   113127.8983  862.4268 -1259437.909   -6742.0675
#> 12   -34166.3985 1465.0862   -82412.847   85126.1980
#> 13     6376.1977 1479.2622  -612558.815   39844.3597
#> 14      324.2266 1474.5156  -532789.162   46783.3630
#> 15   -36150.6952 1482.0887   -80109.626   85891.0886
#> 16   -60088.1623 1502.2162   285783.867  109616.7466
#> 17   -49295.4252 1518.2558    88753.013   97287.6590
#> 18   -53608.4308 1513.3211   169910.517  101894.8677
#> 19    16078.0881 1510.8802  -777692.836   27179.4066
#> 20   -60041.9328 1488.0020   312285.023  110433.5433
#> 21   -63676.7725 1482.6834   369045.632  114864.2992
#> 22    -8937.3876 1448.8474  -392582.523   57889.8063
#> 23   -56673.2490 1488.7445   265877.120  106482.3691
#> 24    -3772.4820 1447.1960  -455620.607   52697.5935
#> 25   -42970.1297 1518.2692   -15287.695   91012.9792
#> 26    12312.0858 1492.8844  -717886.695   32889.9571
#> 27     5959.9459 1486.5399  -630994.380   40208.0293
#> 28  -385073.8269 1872.4850  3662410.836  578551.1174
#> 29  -264023.4767 1890.0043  2275278.641  389940.2597
#> 30    -9263.5960 1082.0648  -114225.199   99819.9361
#> 31  -422714.0010 1881.1845  4111543.629  633125.0407
#> 32  -386088.8789 1877.4054  3649107.274  580335.5757
#> 33   -24607.6650 1140.9627    68970.754  109408.9378
#> 34   -16398.8186 1113.1502   -18941.395  102870.7210
#> 35    10215.0783 1021.2027  -300697.695   82679.2045
#> 36  -434508.1502 1889.9572  4224035.331  650395.5578
#> 37    -3316.9323 1063.1281  -138883.151   91354.3534
#> 38  -313068.9002 1929.8201  2789155.273  459110.3772
#> 39  -328857.1354 1919.1831  2954570.543  486218.8079
#> 40    60560.0941  931.0421  -805157.172   40665.3196
#> 41    75320.4820  916.9713  -926583.520   22838.5010
#> 42    75320.4820  916.9713  -926583.520   22838.5010
#> 43    95848.9398  905.1420 -1089516.925   -3795.0879
#> 44    80610.3920  915.8819  -964174.857   15087.8773
#> 45  -184277.0281 1941.0583  1329070.347  259486.6497
#> 46    43616.2484  938.5308  -659396.863   63283.9288
#> 47    82597.5400  913.4838  -974399.980   13039.2654
#> 48   217525.9854 1232.4024 -1814381.534 -268674.5242
#> 49    43339.2448  939.9434  -653914.088   64026.9148
#> 50    55654.9480  933.9752  -753019.331   47729.7735
#> 51    55654.9480  933.9752  -753019.331   47729.7735
#> 52    22062.1408  954.1994  -467936.880   90167.0728
#> 53    33238.1607  947.7539  -565017.870   77072.6511
#> 54   231864.1852 1152.9641 -1806971.063 -287881.5750
#> 55   197765.8327 1271.4778 -1553306.927 -256622.9916
#> 56  -110221.4943 1547.3084   779109.775  176467.9828
#> 57   -76769.1874 1606.3319   201000.429  140370.4074
#> 58   -38625.6829 1806.8724  -541517.284   95316.3375
#> 59   -63912.3319 1644.6805   -40159.793  124828.8271
#> 60  -190757.5264 1919.7133  3505880.243  164438.2029
#> 61  -202997.0643 1926.5791  3326712.253  196125.2299
#> 62  -211406.3901 1941.2597  2973069.356  229998.4936
#> 63  -210679.8468 1935.3546  3119108.454  221071.3470
#> 64  -199975.0631 1925.7542  3608043.183  174901.4553
#> 65  -206917.8745 1944.4321  2605267.850  242538.6225
#> 66  -202624.7351 1927.9954  3622799.550  178667.7762
#> 67  -209513.7449 1934.5864  3353133.648  205773.4992
#> 68  -211237.8822 1941.5501  2972884.594  229793.9790
#> 69  -205635.3681 1932.0718  3550219.828  187828.7203
#> 70  -185377.9964 1951.1932  1739228.420  251969.5588
#> 71  -212393.3866 1951.8227  2808519.808  240235.2653
#> 72  -200455.0320 1954.3058  2263266.885  249432.9448
#> 73  -143270.7733 1646.6389   984289.775  219355.7552
#> 74  -214082.7501 1942.5654  3353817.877  213348.6553
#> 75  -193092.2816 1958.9010  1965563.829  252545.4822
#> 76  -123381.4265 1547.9353   843729.543  211278.9096
#> 77  -132788.5914 1800.7880   586013.921  207441.2003
#> 78  -172567.6874 1681.0882  1312620.047  248365.8787
#> 79   -69587.5310 1067.2864   265042.185  217923.2435
#> 80  -150927.9300 2043.6393   485342.165  235680.2792
#> 81   -86201.7359 1092.5031   344659.618  245427.7281
#> 82  -196344.7788 1827.2046  1387364.477  281334.7158
#> 83   -94840.2134 1117.7024   385778.098  259092.4196
#> 84    88832.0930 1090.1335  -320266.811 -100304.7849
#> 85    94853.4046 1266.5397  -425766.964 -132884.9746
#> 86    92144.9834 1252.2975  -388473.475 -128103.8606
#> 87    93592.8642 1202.1835  -354617.054 -125644.1508
#> 88    94424.0437 1225.2722  -372982.873 -129998.0708
#> 89    92508.9012 1195.0274  -338775.605 -123609.0478
#> 90    88394.0305 1068.0684  -231685.517 -103630.3575
#> 91    86801.0488 1225.4633  -325963.319 -118443.6427
#> 92    97882.2216 1122.6908  -294124.725 -128406.4833
#> 93  -139584.6470 1485.4108   656509.208  293888.2591
#> 94    92485.1284 1135.0861  -276281.073 -120268.2631
#> 95    92485.1284 1135.0861  -276281.073 -120268.2631
#> 96   -13725.4788 1564.0833  -358883.890   42015.3089
#> 97  -141421.9550 1488.2416   610544.692  303215.8058
#> 98    44734.4267 1397.3587  -355335.236  -58274.1912
#> 99  -141459.1913 1496.3229   624793.940  301092.4206
#> 100 -143220.5100 1474.5308   578493.172  312476.3368
#> 101 -142373.7843 1501.1095   624931.937  302731.9265
#> 102 -146815.5444 1477.5205   585957.859  319636.6726
#> 103 -144904.5666 1438.4274   527726.784  327225.8201
#> 104   -4985.7253 1566.4339  -513759.525   32135.1228
#> 105 -151033.0560 1487.7583   655994.168  320705.5714
#> 106 -141740.3883 1394.6919   481564.659  331192.4312
#> 107  -17993.3721 1509.1135  -281503.870   53207.6077
#> 108 -151995.6461 1550.0314   682777.091  312816.7669
#> 109   30909.3443 1368.0977  -337529.864  -27406.0827
#> 110   -3504.9358 1500.5130  -426698.239   31623.7643
#> 111   -9014.0410 1488.5986  -337812.242   39675.3875
#> 112     990.5885 1468.7515  -407528.500   24701.8016
#> 113 -163471.1631 2475.1283   638125.971  229920.0292
#> 114 -185670.4235 2505.6120  1118250.208  236180.4038
#> 115 -190047.0430 2528.6580  1180833.522  236249.6861
#> 116 -190047.0430 2528.6580  1180833.522  236249.6861
#> 117 -186184.4000 2536.2106  1098221.332  234567.3488
#> 118 -154249.5910 2476.4579   446854.735  226919.7762
#> 119 -165277.6527 2511.2959   653600.189  228890.3772
#> 120 -192805.6089 2512.0242  1260282.533  239242.4840
#> 121 -181903.6282 1419.2524  2230628.919  260956.8251
#> 122 -181903.6282 1419.2524  2230628.919  260956.8251
#> 123 -367268.1810 2826.5877  3230432.334  341194.4827
#> 124 -289639.3230 2249.7365  2690581.854  316080.1032
#> 125 -169612.5550 1300.5282  2242796.483  252801.2130
#> 126 -185156.1065 2538.2286  1087449.696  234668.1033
#> 127 -185156.1065 2538.2286  1087449.696  234668.1033
#> 128 -402131.2475 3224.2696  3413334.507  339344.6847
#> 129 -378647.4357 3032.3658  3355610.759  325978.4498
#> 130 -336974.3131 2723.5689  3045843.110  314162.5074
#> 131 -336974.3131 2723.5689  3045843.110  314162.5074
#> 132 -171405.2734 1419.2507  2331464.622  234054.0115
#> 133 -362848.4477 3188.5182  2895028.235  314445.9755
#> 134 -204483.5301 1748.5232  2470908.538  242254.1897
#> 135 -348299.8267 3255.3608  3257235.180  251606.3767
#> 136 -178000.2035 1420.0828  2213543.938  257405.0120
#> 137 -280494.7120 2604.0982  2797314.222  247141.3514
#> 138 -333908.0800 3379.0276  2983579.820  231807.0273
#> 139 -276573.6807 2625.2679  2770948.252  239456.3527
#> 140 -199732.2526 1623.9873  1959943.463  292079.0966
#> 141 -334324.2204 3430.1861  3117415.475  215783.4141
#> 142  -71295.7136 1257.5318   138451.758  186574.3669
#> 143   74327.6713  924.3347  -318004.266   10282.2021
#> 144   49304.6960  919.8046   -85097.786   13732.2833
#> 145  -76335.4903 1274.3982    92957.924  199308.3103
#> 146   10600.1406  914.4500   127167.367   64317.0502
#> 147  -13471.0788  915.0865   261735.699   94233.6288
#> 148   83822.4040  921.1526  -381145.191    3166.8334
#> 149   22245.4269  916.2307    70732.831   47202.6460
#> 150   12879.1481  914.9988   115167.144   61427.9867
#> 151  -75329.0773 1261.5185   126614.552  195708.2544
#> 152   77384.2803  918.0870  -350558.837   13142.5387
#> 153    3723.9289  916.5673   157506.502   75096.2877
#> 154   32390.5547  919.1853    14358.533   34267.5927
#> 155   48825.8983  917.9030  -114832.004   25798.9385
#> 156   48825.8983  917.9030  -114832.004   25798.9385
#> 157 -210174.2467 2306.5757  1674764.178  279986.4626
#> 158   73199.5039  921.6982  -226773.415  -12134.9126
#> 159   35750.1395  919.8772    -6567.553   30994.0114
#> 160   10204.8940  917.2861   120212.703   67923.2084
#> 161   29286.1764  917.9378    22319.488   41970.7931
#> 162   -7613.6771  916.7200   213918.748   92064.8662
#> 163 -215054.3590 2314.7797  1720538.722  284485.9127
#> 164   45823.6375  916.6452   -82673.214   26247.7537
#> 165   -9670.8016  920.1687   231837.682   92200.8317
#> 166 -229352.2276 2444.8999  1864340.051  280013.0200
#> 167  -15623.3324  920.7679   258557.647  101671.3436
#> 168  -72050.4216 1085.2381   301828.405  196017.8208
#> 169  -73446.1605 1128.6538   237966.969  197644.3435
#> 170  -78509.3118 1207.1866   190248.460  209730.9293
#> 171 -238168.4958 2529.8486  1962387.764  274489.0204
#> 172  -78725.6383 1125.4384   255355.236  209300.9513
#> 173 -226726.0507 2387.3109  1806286.053  289710.2879
#> 174  -85934.7497 1110.7229   305232.580  223583.3988
#> 175 -240868.1010 2584.5179  1935248.360  272969.5941
#> 176 -194002.8409 1235.9258  2553141.805  292182.3513
#> 177 -216607.4523 1489.4633  2427210.064  308468.2918
#> 178 -205975.8903 1365.6900  2437936.043  308973.6152
#> 179 -217659.1890 1052.4122  2089726.401  419668.8203
#> 180 -206699.7842 1056.6526  1912461.327  421840.7036
#> 181 -241927.7108 2544.1850  1539234.321  313646.7170
#> 182 -230444.3039 2512.3871  1484250.780  299254.0787
#> 183 -203121.4240 2165.1431  1317042.419  311259.6486
#> 184 -198229.7978 2102.1386  1296741.692  313112.9388
#> 185 -224767.1938 2441.9280  1297307.701  313920.8719
#> 186 -188642.7272 2000.7255  1193861.665  317259.7262
#> 187 -244025.7780 2481.3103  1340875.975  343291.2218
#> 188 -244025.7780 2481.3103  1340875.975  343291.2218
#> 189  -46394.5721 1675.1169  -215527.154  261232.8530
#> 190 -235367.1795 2456.8747  1259099.658  336243.4657
#> 191 -232980.3875 2451.6224  1243751.292  333581.7391
#> 192 -229600.8921 2422.1781  1209833.324  334260.1732
#> 193 -203814.0817 2172.2072  1129195.354  327167.6944
#> 194  -87660.7646 1005.3942   368406.648  272760.1338
#> 195 -174625.7053 1721.3820  1021084.337  357500.0743
#> 196   -3285.4307 1959.1264  -425191.460  172832.8342
#> 197 -184074.1171 1689.1725   939138.349  386728.3847
#> 198 -185780.2392 1694.0406   973015.225  386206.3017
#> 199 -186030.7962 1694.7429   977630.422  386169.9062
#> 200 -186537.4499 1696.1612   986659.723  386128.1482
#> 201 -183369.2649 1679.8991   921792.762  388446.4518
#> 202 -184207.7770 1682.1969   939538.812  388085.4012
#> 203  -33949.8162 1046.5221  -130285.655  180424.3192
#> 204 -160935.0200 1365.1164   438405.363  457756.5420
#> 205  -78598.4471 1045.6182   143520.768  285420.9922
#> 206  -78598.4471 1045.6182   143520.768  285420.9922
#> 207  -64861.3291 1057.4403    52765.840  252365.9345
#> 208  -36863.5864 1691.5145   509393.789  159628.4008
#> 209   17236.2583 1602.0339   205043.086   98412.4403
#> 210   24208.5314 1615.3959   206590.708   85044.2497
#> 211  -32807.2793 1043.1543  -134182.608  178165.9253
#> 212 -170826.7576 1529.1855   729414.793  401540.9814
#> 213   36925.1491 1623.3553   169326.587   63673.8471
#> 214  -57966.6795 1051.5832     2436.564  241469.3090
#> 215   56854.5722 1637.2998   128406.023   30594.7083
#> 216   20062.0452 1629.2339   206537.592   86797.3299
#> 217   39272.1348 1646.5835   179764.367   53491.1264
#> 218 -243867.4847 2289.9466   852188.859  423578.6243
#> 219  -34700.2438 1046.4776  -147836.369  189562.0228
#> 220  -34618.6349 1046.2726  -145701.920  188749.0080
#> 221   33723.9624 1642.1759   197363.378   60217.1297
#> 222  -31244.9968 1039.4725  -147696.541  177677.3393
#> 223 -190355.4221 1863.7143   378408.565  426335.3159
#> 224   39700.8966 1670.8874   195492.812   46092.9608
#> 225   55632.1132 1679.7401   166844.026   19408.4145
#> 226 -277268.3775 2258.9397   977427.643  481084.3382
#> 227 -173281.7978 1817.8838   221102.330  413922.0725
#> 228 -160564.7285 1491.1515   655147.838  389044.1918
#> 229 -275654.4888 2214.2461  1229724.055  432440.2649
#> 230 -297177.4309 2260.0504  1296364.199  458957.3838
#> 231 -156175.8577 1472.3619   623903.757  384070.0997
#> 232 -324593.3793 2309.0069  1384241.950  494292.0260
#> 233 -349982.1056 2363.4397  1298328.572  563989.8172
#> 234 -159197.7534 1487.8659   654933.358  384963.1565
#> 235 -398664.2827 2432.2159  1519729.826  617108.0881
#> 236 -158792.8596 1484.8199   653252.320  384130.9513
#> 237 -326114.7981 2270.5706  1445936.250  491326.8812
#> 238 -332264.6846 2280.1665  1466285.580  499631.5420
#> 239 -182318.5828 1744.3285   510937.084  403227.1057
#> 240  -19726.1565 1020.1518  -198771.713  156268.4182
#> 241  -20074.8165 1021.4887  -193923.181  155976.0386
#> 242  -20074.8165 1021.4887  -193923.181  155976.0386
#> 243  -19542.9684 1020.8089  -191417.312  153530.3148
#> 244  -17999.2663 1014.2908  -223303.221  157810.0278
#> 245  -18049.4264 1014.1642  -236696.699  161519.5936
#> 246  -18252.7623 1016.6229  -224754.875  158609.8591
#> 247 -171146.2617 1602.9294   702907.758  379842.8632
#> 248  -18019.2030 1021.6538  -199781.264  150502.4703
#> 249 -165217.3279 1565.8182   661127.243  377536.2743
#> 250 -178380.1592 1916.8731   378363.699  376431.4645
#> 251  -16068.2500 1007.1735  -269386.313  164392.8460
#> 252  -16009.9485 1010.6564  -248879.614  158256.4795
#> 253  -16009.9485 1010.6564  -248879.614  158256.4795
#> 254 -167684.0413 1576.6361   679115.998  379161.6130
#> 255  -16371.9070 1007.3776  -285299.251  169536.6653
#> 256  -14502.1275 1004.6064  -273839.011  160504.4856
#> 257  -14946.7841 1012.3736  -250139.654  154651.2822
#> 258 -173771.6685 1655.4166   715547.162  374433.7636
#> 259  -43144.7600 1077.0897    -1143.874  180965.6355
#> 260 -170053.5131 2039.9173   201556.511  353985.4690
#> 261  -16414.0742 1022.7193  -242681.136  155801.5291
#> 262  -44765.4389 1081.2053     6716.216  184024.3398
#> 263  -48997.7190 1086.2448    33058.736  191719.6616
#> 264 -171471.6781 1997.3640   296078.756  352876.4788
#> 265  -35324.5855 1035.6911  -144368.944  212285.5680
#> 266  -15706.0228 1018.6194  -261404.647  158829.9733
#> 267 -171575.5944 1677.2466   693860.889  367589.6283
#> 268 -166848.3066 1648.2507   661878.966  365749.7125
#> 269  -28145.6768 1047.4226  -190221.294  194603.9392
#> 270  -18609.2215 1037.1718  -217254.856  154216.6443
#> 271  -25077.7129 1050.4493  -216363.528  187789.6551
#> 272  -17375.8212 1033.9439  -236329.639  155371.1683
#> 273  -45143.7500 1093.5250     3725.491  184002.7005
#> 274  -17037.8433 1029.7799  -286498.780  168145.0907
#> 275  -47488.8626 1100.5164    18880.683  187557.6424
#> 276  -34242.1652 1075.1867  -103643.115  196732.1494
#> 277  -15904.0112 1064.3574  -282876.223  166192.5845
#> 278 -188152.0769 2348.1441  1018304.734  259652.7570
#> 279 -341357.5690 2378.1153  1542519.667  488656.8007
#> 280 -132344.1031 1646.7906   334165.371  319262.8160
#> 281 -266789.1064 2481.5233  1400707.181  342169.7570
#> 282 -142698.4030 1656.7555   452473.925  330237.6444
#> 283 -142698.4030 1656.7555   452473.925  330237.6444
#> 284 -127089.8701 1675.8419   278359.978  306953.1923
#> 285 -110327.2244 1752.3522    74069.972  272743.7364
#> 286 -110327.2244 1752.3522    74069.972  272743.7364
#> 287 -136964.9589 1681.7664   386542.078  318254.5638
#> 288 -105246.3559 1778.6204    14365.718  261572.2259
#> 289 -271046.1413 2481.2527  1405717.258  346599.6238
#> 290 -271046.1413 2481.2527  1405717.258  346599.6238
#> 291 -369642.2859 2470.0411  1879851.901  497938.5961
#> 292  -55935.7194 1239.1633   300767.231  169273.2799
#> 293  -55935.7194 1239.1633   300767.231  169273.2799
#> 294 -145081.8642 2231.9558    -4660.829  268519.8045
#> 295  -50440.8655 1227.0288   231798.616  165634.4332
#> 296  -43950.0910 1219.0856   159002.651  158972.9414
#> 297 -115330.0589 2224.2422  -323211.609  238055.9402
#> 298 -317014.3021 1768.5059  1649888.763  522700.3753
#> 299 -101012.7156 1227.3100   753389.649  238606.4273
#> 300 -150833.6456 2208.1262    40107.309  283069.4938
#> 301  -51369.1769 1213.9204   221933.031  172830.1559
#> 302  -91789.3924 1231.0009   658909.554  224336.2937
#> 303 -316720.3305 1765.1305  1659452.103  522416.9007
#> 304  -28935.9142 1172.0696   -55589.703  153696.5789
#> 305 -346954.0761 1907.3324  1695892.890  555294.1424
#> 306 -346954.0761 1907.3324  1695892.890  555294.1424
#> 307  -66584.3525 1227.9303   388324.489  190439.4618
#> 308  -39617.0460 1200.6969    94622.516  159841.1983
#> 309  -54126.5909 1182.3182   206719.007  190507.4020
#> 310 -294275.3218 1647.8101  1677451.883  498701.5649
#> 311 -285202.1458 1614.6905  1656950.430  488376.5642
#> 312 -256379.5172 1477.4379  1619870.466  457362.9421
#> 313 -197135.2414 1278.0338  1377944.023  399495.7357
#> 314 -188369.5116 1245.8351  1326780.928  393485.2288
#> 315 -194872.8311 1267.1337  1353429.509  400035.9280

fitted(m)
#>   [1] 130122.22 128470.95 115405.78 145972.80 158505.05 162891.77 146109.45
#>   [8] 206429.48 163207.36 304239.37 226511.92 218422.13 140765.04 124688.26
#>  [15]  80351.69 128513.85  84923.57 109233.59  96121.49 130744.65 238821.49
#>  [22] 147422.68 106056.49 190789.84 136944.32  65581.11  83690.98  67900.95
#>  [29] 233728.04 132218.34  83769.54 131871.75  94978.90  90480.45  69238.14
#>  [36] 190630.27 229832.95 132334.05 200583.78 264151.53 229398.68  94386.62
#>  [43]  87967.82 128272.38 120344.45 283961.73  64120.76  79701.58 235900.98
#>  [50]  91832.08 160395.05  94082.82  54332.56  67505.74 189733.33 230037.09
#>  [57]  90413.25 113341.46 151706.85 131221.94 206268.52 142197.06 108328.09
#>  [64]  85496.39 144048.85 138462.47 120980.05 131401.31 196427.83  69046.14
#>  [71] 286747.95 222648.10 184773.72 142082.92  96516.26 101241.20 124862.69
#>  [78] 111912.87 128180.48 146539.67 178273.46  80614.03 239893.47  97545.62
#>  [85]  86330.58 180408.02 115647.65 102749.30  86290.55  97925.53  87950.61
#>  [92] 170197.77 122965.43 138550.73 152325.05 134163.68 123311.10 103719.87
#>  [99] 135309.89 120577.45 167946.35 111661.55  89819.38 246475.63  77026.42
#> [106] 129612.37 121661.56 237328.72  85795.14 103116.59 142933.53 114066.62
#> [113] 110961.01 102536.76 169453.80 125529.91 186217.70 227627.09 100637.31
#> [120]  82915.11 171901.24 176404.73 126730.90 131728.61 148961.53 120867.99
#> [127] 309737.26 269125.60 104345.26 207082.16 157276.23 157276.23 148743.57
#> [134] 147033.93 199513.26 234427.42 161881.76 140299.71 447090.71 155787.01
#> [141] 239782.62 205111.29  94912.85 118382.04 133616.45 142567.79 125327.12
#> [148] 109377.71  92067.22  93183.09 195854.95 154592.02 100145.68 134579.39
#> [155]  93124.26 100908.36 121102.22 103229.84  85847.96 140142.63 152230.72
#> [162] 122920.91  91153.42  72380.45 104764.06 160970.05 193752.17 104719.10
#> [169] 132004.26  97045.35 111433.81 193259.44 142656.17  97604.86  61582.16
#> [176]  63404.68 233690.95 166991.75 256479.22 176428.19 163826.07 289752.78
#> [183] 172808.04 109560.61 184556.49 219209.00 271022.46 152536.35 192237.32
#> [190] 126184.50 183416.29 354851.17 304378.34 113667.02 184071.43 230266.37
#> [197] 129509.01 196567.45  98353.97 192802.21 183246.93  34659.46  86602.66
#> [204] 102170.30 112933.73 120283.62 149560.93 111856.94 208428.49 435565.93
#> [211] 234847.83  69680.37  94012.28 244205.52  89953.63 287725.01 168884.18
#> [218] 252293.11 169171.82 203418.48 127958.49 190008.75  54341.83 104781.95
#> [225] 156959.99 248096.26 170413.39 120729.64  96329.45 189750.47 238485.24
#> [232] 235041.16 129937.65 170813.30 103493.14 287158.13 124120.31 198875.14
#> [239] 438194.66 232972.93  65619.11  58425.13  59446.62  47249.10  82160.33
#> [246]  82832.79 140188.11 143414.38 100561.40 228723.72  98351.99 108416.16
#> [253]  64547.38 121144.14 200475.65 151164.72 123202.97  80882.60 147792.76
#> [260] 111143.45 102305.04 106252.36  99397.20 104814.90 206887.58 156294.57
#> [267] 119046.50 288740.26 231276.92 235511.43 126530.28 135603.14 116659.92
#> [274] 116168.93 117260.72 126232.78 179243.85 177564.29 158052.57 148297.49
#> [281] 100214.59 549026.25 126216.09 109648.53 149597.94  80594.07  82346.42
#> [288]  60916.21 170900.68 182450.77 187413.27  95626.66 134780.15 117431.87
#> [295] 140955.53 130781.40 104753.03 178005.12 156580.70 112127.57 364260.80
#> [302] 154234.85 108635.02 174698.94 106356.07 164856.30 164856.30 114938.68
#> [309]  69493.83 100420.70 128004.54 106108.30 204475.39 215754.10 109395.09
#> [316] 346433.60

residuals(m)
#>   [1]  26877.78445 -14970.94600 -33655.77743   4027.20443  31494.95133
#>   [6]  -2941.77140   3885.55310  33520.51611 -10207.36216 -54289.36737
#>  [11]  20488.08086  42577.87351 -37765.04292  -1188.26203  22648.31332
#>  [16] -28513.85186   5026.43400 -14233.59343  -6621.49125   5255.34879
#>  [21]  31178.50582 -12422.68153   8943.50532   4210.15704 -12944.32164
#>  [26]  18418.89166   3309.01710  -3950.94501  -3728.03866   9781.65942
#>  [31]  12230.45803  -4871.74988  17021.09643   4519.54644    761.86184
#>  [36] -30630.27092 -43332.94756 -12334.04803  19416.21888 -26651.52955
#>  [41]    601.31941 -17386.62213 -42967.82287  -3272.37740  54655.54773
#>  [46]  76038.26558  -8620.75648   5298.41508  13099.01797 -21882.08467
#>  [51] -10445.05496  12917.18074  12167.43834   1994.26087   5266.66589
#>  [56]  14962.91196  14586.74810  11658.54144  28243.14839  -8221.93761
#>  [61]  18731.47587   4802.94448    671.90966   4453.60747  -9048.85197
#>  [66]  -9462.47252  14019.94927   5598.68539 -81427.83430  10903.86031
#>  [71]  62252.04596 -42648.09773  21226.28066 -12083.92308  -7516.26289
#>  [76]  31758.80081  -1362.69436 -29912.86629 -28180.47697 -52039.67249
#>  [81]  22726.53861  -9614.02879   5106.53451  10954.37751   1619.41708
#>  [86] -58908.02051  -6647.64818   2245.70441  13659.44623     74.47167
#>  [91]   2049.38764  -1197.77310   7029.56530  -8550.73199 -25325.05474
#>  [96]  -9163.67635  10688.89835 -13719.87400   -809.89345 -23077.45479
#> [101]  -1446.34580  11338.45012   7680.61883  26524.36845   6973.57744
#> [106]  22387.63465 -41661.56348  -2328.72412  28704.86125  -4166.58601
#> [111]  15066.46505 -26066.62177   9038.98640 -13036.76405  10546.20240
#> [116] -10529.91000 -41217.70274  22322.91194  14362.68991   4084.88696
#> [121] -16901.24050    595.27099  36269.10370 -46728.61274   6038.47324
#> [126]  20132.00696  28262.74065    874.39766   3654.74158  59417.84064
#> [131] -12276.22744 -12276.22744 -38743.57021   5466.06846 -69513.25595
#> [136]    572.58352  -5381.76209  38200.29296  72909.29008  16212.98848
#> [141] -29782.62048 -15111.29319   5087.15221  -4271.04432  38383.54986
#> [146]  27432.20702  14672.87799  -9382.71284  -5067.21979 -10183.08543
#> [151] -33854.94539 -11592.02078 -12645.67579 -44579.38725  20875.73697
#> [156]   6591.64324 -23102.22265  20770.15603 -13347.96253  -1642.62876
#> [161]  26269.27873   9079.08977 -21153.42209  30619.54867  -1264.05743
#> [166]  37029.94832 -83752.17136  24280.89601  -2009.26060 -22045.34612
#> [171] -16438.81004  23740.55703 -13656.17441   -604.85687   3417.84034
#> [176]  46595.32274 -53690.94585   5008.24738  38520.78408 108571.81170
#> [181]  13673.92979 -14752.77860 -35308.03906   4439.38993  28693.50961
#> [186] -44208.99816 -51022.46332   4463.64953 -19237.31503  58815.49643
#> [191]   6583.70686  70148.83396  75621.65644   7332.98460  15928.56863
#> [196] -10266.36957  35490.99328  48932.54615  16596.03486 -37802.20938
#> [201] -46246.92915  18340.54189  15397.34089 -10175.30112  35566.27400
#> [206]  10716.38321 -14560.92744 -16856.93942   2571.51059 -45565.93128
#> [211]    152.17381   3819.62564   3987.71998  33794.47559  -1953.63349
#> [216] -17725.00707 -26884.18297  15706.89246  40828.17650   9581.51853
#> [221]  -3958.48651 -16508.74836  -9341.82644 -21781.94995   2040.01301
#> [226]  46903.74226 -43913.39079  19270.35923   1170.55147    199.53345
#> [231] -48485.24253 -17041.16404 -14937.64914  -5813.30193  30506.86209
#> [236]  -6958.12986   7879.68956  -8875.13516  61805.34478 -52972.93297
#> [241]   4375.88521   -675.12959  -4446.61828  12250.89954  -8660.33488
#> [246]  -6832.78728 -50188.11415 -38414.37519   5938.60227   9276.28168
#> [251]   5648.01280   1583.84037  -5047.37651  11355.86456 -10475.65216
#> [256] -26164.72396   4797.02651   1117.40201 -15792.76210 -51148.45388
#> [261]  15694.96241  11747.63693  -4897.19962 -25814.89526  15612.41927
#> [266]  28705.43395  14203.49747   3259.73794  11723.07585 -20511.43220
#> [271]    469.71586  12396.85575  19340.07625  18831.07467   7739.28383
#> [276]  -2232.78039  -9743.84835  32935.70637   1947.43066   6702.51061
#> [281] -25214.59235  18473.75299  -6266.09007   9351.46534  -9597.93854
#> [286]  19355.93186  16153.57967  20033.78854  -3900.67803 -20450.76522
#> [291]  -4413.27066  23373.34441   8219.84565 -20481.86858  -5955.53330
#> [296]  26718.59603   3246.96903 -63005.11677 -53080.70162  23372.43271
#> [301]  45739.20386  25765.14719 -31635.01756 -32448.94231 -22356.06814
#> [306]  -4856.29926  -4856.29926  -1938.67979  -1493.82810 -16420.69685
#> [311]  21995.45921   3891.69779  33024.61082  39245.89939  20604.91198
#> [316] -66433.60316