Skip to contents

Ensemble partial least squares regression.

Usage

enpls.fit(
  x,
  y,
  maxcomp = NULL,
  cvfolds = 5L,
  reptimes = 500L,
  method = c("mc", "boot"),
  ratio = 0.8,
  parallel = 1L
)

Arguments

x

Predictor matrix.

y

Response vector.

maxcomp

Maximum number of components included within each model. If not specified, will use the maximum number possible (considering cross-validation and special cases where n is smaller than p).

cvfolds

Number of cross-validation folds used in each model for automatic parameter selection, default is 5.

reptimes

Number of models to build with Monte-Carlo resampling or bootstrapping.

method

Resampling method. "mc" (Monte-Carlo resampling) or "boot" (bootstrapping). Default is "mc".

ratio

Sampling ratio used when method = "mc".

parallel

Integer. Number of CPU cores to use. Default is 1 (not parallelized).

Value

A list containing all partial least squares model objects.

See also

See enpls.fs for measuring feature importance with ensemble partial least squares regressions. See enpls.od for outlier detection with ensemble partial least squares regressions.

Author

Nan Xiao <https://nanx.me>

Examples

data("alkanes")
x <- alkanes$x
y <- alkanes$y

set.seed(42)
fit <- enpls.fit(x, y, reptimes = 50)
print(fit)
#> Coefficients of the Models by Ensemble Partial Least Squares
#> ---
#>                      [,1]          [,2]          [,3]        [,4]         [,5]
#> (Intercept)  1.901653e-02 -7.461177e-02     0.1320574    0.105323    0.1189126
#> Chi.P.0     -5.302831e+02 -3.709869e+02  -852.3098957   68.358062  115.5502167
#> Chi.P.1     -9.877642e+02 -9.960761e+02 -1391.6437775   68.890118  124.8610935
#> Chi.P.2      3.344548e+03  3.392111e+03  4469.4736167   64.969199   84.1563591
#> Chi.P.3      2.250893e+03  1.993993e+03  2335.5658948  120.729705  399.2724789
#> Chi.P.4     -3.033318e+00 -3.401355e+00    -4.4700237  -11.705109   -6.1356472
#> Chi.P.5      4.320044e+02  3.237402e+02   425.8828099   52.259068  156.8700697
#> Chi.C.3      5.289307e+01  2.757648e+01    48.1259790   14.367189   34.1522027
#> Chi.PC.4    -2.427201e+02 -2.760505e+02  -256.4640646   -2.679697    6.0979538
#> Kappa.1      4.021214e+03  3.223933e+03  3323.0228511   18.537083 -120.2020096
#> Kappa.2     -1.007953e+03 -1.193883e+03 -1383.2809608   67.772246  170.0821127
#> Kappa.3     -3.481420e+03 -2.950207e+03 -3225.3498579   86.710334   54.4025624
#> Kappa.4     -5.171513e+02 -5.381593e+02  -809.0088168   69.178124  119.3115652
#> Estate.1    -8.626383e+00 -2.293245e+00   -56.1669690 -108.767493 -137.3001764
#> Estate.2    -6.626015e+01 -4.053109e+01   -18.9511325   86.858681  103.4123814
#> Estate.3     1.982168e+01  1.226001e+01    11.2770661  -14.105775    4.1117473
#> MEDV.11     -5.954853e+02 -4.625003e+02  -507.8391153  -26.291676  -32.0770690
#> MEDV.12     -1.913626e+03 -1.627944e+03 -1658.9580775 -107.150598 -229.1887505
#> MEDV.13      1.633341e+01  6.451224e+01    78.6593595   29.799666   -2.5664118
#> MEDV.22     -1.430168e+03 -1.059318e+03 -1136.3537020   83.880364 -414.7353433
#> MEDV.23     -4.781812e+01 -7.608106e+01   -59.3065681  -22.365890  -13.6481712
#> MEDV.33     -9.670372e+00 -1.087472e+01   -11.5639541   -3.741788   -2.2431504
#>                      [,6]         [,7]          [,8]         [,9]        [,10]
#> (Intercept)    0.03354563    0.2194680     0.1318238   -0.1238766    0.1189771
#> Chi.P.0      152.51594055   76.2935918  -271.6383930  135.8188842  142.4976552
#> Chi.P.1      157.89242030   74.1248488  -352.9291993  153.0419860  151.8363758
#> Chi.P.2      164.76123871   89.9017062  1888.5211733  102.7181907  134.7081058
#> Chi.P.3      311.43613429   98.4000481  1115.1708338  400.8698614  293.3837575
#> Chi.P.4       -7.43031099   -9.8787666    -1.5474236   -1.0265474   -2.6639509
#> Chi.P.5       51.24075372   33.5967080   212.3279392  187.4589817  110.5862322
#> Chi.C.3        5.22832172    6.8638503    24.5017035   45.5075439   24.1973044
#> Chi.PC.4     -62.58063876  -18.9893023  -117.5357430   38.1971340    0.4366064
#> Kappa.1      -93.20302840   35.5258531  1826.3209926 -161.6731757 -122.6809025
#> Kappa.2      190.78503248   68.0676573  -391.9388244  209.8760516  197.2229879
#> Kappa.3      161.84747905  130.0452396 -1576.3636661   21.7825866   85.6109132
#> Kappa.4      154.31480015   75.9118023  -164.2766380  143.4737835  147.6716998
#> Estate.1    -102.96442325   28.6773102    14.4900076 -170.1389760 -136.3029164
#> Estate.2      98.90967769   -0.1341941   -35.1055226   84.6676107   68.1925770
#> Estate.3       6.06652442  -11.6677688    11.9044063    6.7164854    4.3325010
#> MEDV.11      -54.85072713  -45.4088533  -304.3559067  -29.0869020  -44.7684618
#> MEDV.12     -263.09492589 -141.7695808 -1038.2345297 -228.8659600 -230.9087996
#> MEDV.13       43.32322414   26.8189406    38.1057912  -11.3640530   18.1967704
#> MEDV.22     -446.95596221   41.1833829  -887.7129591 -493.2372538 -413.3501953
#> MEDV.23      -74.10718236  -48.9844523   -75.0260196  -12.1986668  -52.5774055
#> MEDV.33       -6.43703011   -3.7809051    -7.9963561   -2.0160682   -4.5386650
#>                     [,11]       [,12]         [,13]         [,14]         [,15]
#> (Intercept) -7.643432e-02    0.051518  3.350597e-02    0.08848524     0.1284325
#> Chi.P.0     -4.116212e+02  146.268744 -3.435449e+02  127.99970884  -273.1087948
#> Chi.P.1     -7.236031e+02  154.901447 -8.154771e+02  138.59639383  -365.2667592
#> Chi.P.2      2.559073e+03  136.716347  3.007264e+03  137.91990555  1767.3773483
#> Chi.P.3      1.815325e+03  418.811367  2.000751e+03  288.06490943  1185.6428269
#> Chi.P.4     -4.476818e+00   -5.707532 -5.156540e+00   -5.33395282    -5.2439365
#> Chi.P.5      3.346375e+02  117.885176  3.823241e+02  134.38242799   233.2057308
#> Chi.C.3      3.912270e+01   15.290931  4.422413e+01   34.01411064    28.5858865
#> Chi.PC.4    -2.316692e+02  -28.684281 -2.278714e+02   29.39462668  -130.0577150
#> Kappa.1      2.872082e+03 -132.545491  3.634255e+03 -106.35470361  1566.4078526
#> Kappa.2     -7.856546e+02  201.890965 -1.080569e+03  185.05933052  -431.7394652
#> Kappa.3     -2.502155e+03  112.519798 -3.229675e+03   35.34741667 -1404.4409239
#> Kappa.4     -3.819997e+02  151.758179 -4.157862e+02  135.09796545  -224.4190382
#> Estate.1    -1.125852e+02  -29.764570 -5.722572e+01 -136.30243634  -117.4255687
#> Estate.2     3.495805e+01   56.027402 -1.381231e+01   79.63222542    39.8148369
#> Estate.3     1.241461e+01   13.298480  1.662167e+01    2.08002504     5.2295627
#> MEDV.11     -4.212482e+02  -48.284192 -5.166947e+02  -32.38769467  -257.2639863
#> MEDV.12     -1.463649e+03 -298.164431 -1.803602e+03 -213.55100205  -890.4181531
#> MEDV.13      4.219523e+01    3.442811  3.084466e+01    5.79929885    38.6255150
#> MEDV.22     -1.035321e+03 -568.830489 -1.233976e+03 -375.33599265  -712.2986375
#> MEDV.23     -5.808340e+01  -39.179169 -5.407151e+01  -22.60769702   -48.7117242
#> MEDV.33     -9.993100e+00   -3.168597 -9.068230e+00   -2.64988026    -7.0416908
#>                     [,16]         [,17]         [,18]         [,19]
#> (Intercept) -4.991854e-02  2.601247e-02   -0.09039869  4.367108e-02
#> Chi.P.0     -4.341654e+02 -4.924402e+02   81.14663970 -2.574161e+02
#> Chi.P.1     -6.409553e+02 -4.526843e+02   83.60884568 -3.277260e+02
#> Chi.P.2      2.553823e+03  2.304648e+03   78.54165601  1.756612e+03
#> Chi.P.3      1.535934e+03  1.333460e+03  112.03394421  1.175520e+03
#> Chi.P.4     -5.022880e+00 -2.101812e+00   -9.36263740 -5.780914e+00
#> Chi.P.5      3.141161e+02  2.858129e+02   76.07400063  2.558095e+02
#> Chi.C.3      4.157769e+01  4.104962e+01   23.01252477  3.401404e+01
#> Chi.PC.4    -1.446678e+02 -1.121322e+02   24.29016951 -1.129551e+02
#> Kappa.1      2.247764e+03  1.646679e+03   -6.40544447  1.628363e+03
#> Kappa.2     -6.607715e+02 -5.340953e+02   93.87317748 -4.235058e+02
#> Kappa.3     -2.084942e+03 -1.606209e+03   58.51259336 -1.504202e+03
#> Kappa.4     -3.988112e+02 -3.842319e+02   82.73599653 -2.312067e+02
#> Estate.1    -6.575873e+01 -7.824256e+01 -136.68853849 -6.527305e+01
#> Estate.2    -5.145622e+00  1.153668e+01   82.16763336  2.975808e+01
#> Estate.3     1.070157e+01  1.037679e+01  -16.42751402  1.085370e+01
#> MEDV.11     -3.477124e+02 -2.828228e+02  -22.02353229 -2.641750e+02
#> MEDV.12     -1.217516e+03 -9.745938e+02 -106.22160136 -9.670463e+02
#> MEDV.13      3.597387e+01  3.976063e+01   24.73714010  2.644995e+01
#> MEDV.22     -9.124290e+02 -8.499219e+02   55.18230973 -7.856158e+02
#> MEDV.23     -4.586373e+01 -5.049032e+01  -19.48410665 -4.568809e+01
#> MEDV.33     -7.693331e+00 -7.341857e+00   -3.44978160 -6.629773e+00
#>                     [,20]         [,21]        [,22]         [,23]        [,24]
#> (Intercept)    0.07608963     0.1268432    0.2193043    0.03993086    0.1151202
#> Chi.P.0      136.08033371  -236.4872021   67.7959782  134.28750485   91.8060002
#> Chi.P.1      147.26849243  -362.1264647   68.2608239  140.64879459   94.7497266
#> Chi.P.2      149.39618041  1835.4143630   64.2853437  164.36365115   84.4482703
#> Chi.P.3      357.85502107  1271.8572746  107.7377268  260.46107677  146.8735044
#> Chi.P.4       -5.22634122    -6.2140466   -9.2262272   -3.87709224   -8.1861056
#> Chi.P.5      122.70761000   220.0952008   89.5731290   65.85116570   76.4464716
#> Chi.C.3       25.36761761    20.0352556   28.2279553   12.74770710   21.6824053
#> Chi.PC.4      -4.04971398  -179.2277456   29.2218421  -36.08435183    9.8269785
#> Kappa.1     -103.56169959  2729.8666625    6.5300863  -51.41224230  -13.1993236
#> Kappa.2      189.87780241  -614.0901053   71.2124482  166.71688018  106.4157248
#> Kappa.3       63.90513075 -2179.7361913   82.9243958  128.78420443   72.3294097
#> Kappa.4      144.62007947  -260.9007862   68.2855444  140.94835574   93.5582262
#> Estate.1    -127.12874248    30.3059763  -87.1064986 -102.34615252 -163.2721306
#> Estate.2      85.87107169   -57.7260112   96.1044043   94.40004540   86.6134875
#> Estate.3       5.51792525     1.6496075  -16.8461025    1.14322489  -15.1374987
#> MEDV.11      -41.87856637  -387.1453439  -34.4860228  -59.50219916  -27.1793205
#> MEDV.12     -252.40302893 -1311.9102489 -114.1362380 -245.94779139 -114.2633168
#> MEDV.13       11.74808487    29.4948141   28.0588315   43.55815423   26.6112658
#> MEDV.22     -448.28052723  -688.9737556   66.4605354 -343.25929022   26.0039382
#> MEDV.23      -35.19028342   -64.3410135  -37.2308140  -76.16638073  -27.6305916
#> MEDV.33       -3.54817693    -8.0855337   -4.5710165   -6.24786444   -3.7583425
#>                     [,25]        [,26]         [,27]         [,28]        [,29]
#> (Intercept) -5.375315e-02   -0.0449627    0.03942239 -3.752796e-02   -0.1994116
#> Chi.P.0     -1.670833e+02  146.4793729  114.72226632 -1.510953e+02  109.1627414
#> Chi.P.1     -4.532437e+02  158.4834983  123.50743419 -4.245698e+02  128.2261813
#> Chi.P.2      1.765803e+03  147.9203541  181.14999798  1.915456e+03   25.0600470
#> Chi.P.3      1.261962e+03  267.4913755  175.94274501  1.403486e+03  457.4328256
#> Chi.P.4     -6.106306e+00   -4.1527290  -11.35336397 -5.518653e+00   -4.9862781
#> Chi.P.5      2.375836e+02  118.8424075   68.75680634  2.556781e+02  211.2439748
#> Chi.C.3      2.425268e+01   32.9457368   13.65619640  2.614799e+01   46.7980473
#> Chi.PC.4    -1.542709e+02   25.1757332    7.51171960 -1.677435e+02   36.7668483
#> Kappa.1      1.910899e+03 -124.5072389  -19.41858108  2.533743e+03 -178.5083100
#> Kappa.2     -3.532323e+02  207.9404612  156.18365152 -5.249337e+02  175.7125712
#> Kappa.3     -1.648593e+03   57.6153248   48.78095331 -2.140056e+03   39.4844740
#> Kappa.4     -2.476681e+02  153.5139575  125.04458212 -1.317291e+02  116.0038207
#> Estate.1    -8.604113e+01 -135.2635859  -84.11353063 -7.889801e+01 -165.8274860
#> Estate.2     2.528057e+01   88.6586402   61.45326006  2.109762e+01  111.6618201
#> Estate.3     1.124319e+01    3.6644330   -0.20583020  1.384411e+01    4.9389289
#> MEDV.11     -3.013461e+02  -33.0503402  -40.71795309 -3.610983e+02  -17.9079383
#> MEDV.12     -1.058776e+03 -220.7011203 -211.53211454 -1.319715e+03 -202.5547298
#> MEDV.13      3.087850e+01   14.3895179   23.09839503  2.819285e+01  -25.6019070
#> MEDV.22     -8.796965e+02 -411.6846267 -254.34900979 -1.024807e+03 -434.9342519
#> MEDV.23     -5.343412e+01  -32.3829464  -34.58652188 -5.115407e+01   10.9854911
#> MEDV.33     -7.410050e+00   -3.3189365   -3.66737381 -7.907692e+00   -0.7316730
#>                     [,30]         [,31]         [,32]         [,33]
#> (Intercept)  1.205334e-02  5.206024e-02 -4.029998e-02  8.297816e-02
#> Chi.P.0     -4.634144e+02 -5.330901e+02 -4.342028e+01 -3.882936e+02
#> Chi.P.1     -4.415865e+02 -9.738780e+02 -5.584459e+02 -1.038380e+03
#> Chi.P.2      2.144998e+03  3.433004e+03  1.896952e+03  3.721466e+03
#> Chi.P.3      1.306892e+03  1.850000e+03  1.280027e+03  2.429310e+03
#> Chi.P.4     -4.962519e+00 -3.853361e+00 -7.970297e+00 -4.122906e+00
#> Chi.P.5      2.707146e+02  3.313908e+02  2.645127e+02  4.529964e+02
#> Chi.C.3      3.897312e+01  3.648324e+01  3.500741e+01  5.180833e+01
#> Chi.PC.4    -1.224644e+02 -2.096124e+02 -1.359228e+02 -2.956173e+02
#> Kappa.1      1.936515e+03  2.542835e+03  1.779198e+03  4.286819e+03
#> Kappa.2     -4.595479e+02 -1.042065e+03 -5.175126e+02 -1.454575e+03
#> Kappa.3     -1.747948e+03 -2.409877e+03 -1.661253e+03 -3.902540e+03
#> Kappa.4     -3.482131e+02 -6.203178e+02 -3.063651e+02 -5.243137e+02
#> Estate.1    -9.431619e+01  1.130831e+01 -8.732116e+01 -3.850858e-01
#> Estate.2     2.884014e+01 -3.253993e+01  3.766083e+01 -7.734652e+01
#> Estate.3     8.134488e+00  1.051679e+01  1.389204e+01  2.340272e+01
#> MEDV.11     -3.091408e+02 -3.892365e+02 -3.039101e+02 -6.241240e+02
#> MEDV.12     -1.051120e+03 -1.363469e+03 -1.050406e+03 -2.101732e+03
#> MEDV.13      3.853810e+01  6.194110e+01  3.390729e+01  2.855113e+01
#> MEDV.22     -8.307962e+02 -1.007753e+03 -8.561366e+02 -1.448572e+03
#> MEDV.23     -4.587790e+01 -6.555470e+01 -5.249892e+01 -6.130511e+01
#> MEDV.33     -7.552957e+00 -1.001687e+01 -7.736238e+00 -1.041008e+01
#>                     [,34]         [,35]        [,36]         [,37]
#> (Intercept)    0.02221307    -0.3743566    0.1868637     0.1816148
#> Chi.P.0      121.16337890  -168.1347140   98.2247544  -720.1937726
#> Chi.P.1      130.40375190  -204.5225018   97.6709673  -974.3077739
#> Chi.P.2      171.92842314  1510.6443630  109.7363999  3510.9894665
#> Chi.P.3      331.35543886  1115.0957904  111.4248478  2228.5777654
#> Chi.P.4       -6.74805243     3.8046037   -8.2033577    -7.6206994
#> Chi.P.5       77.70726546   208.1170949   22.3583753   412.7253829
#> Chi.C.3       14.39907636    24.0477014    4.9395397    44.2268910
#> Chi.PC.4     -46.49614954  -146.9644272  -26.6164129  -268.1127031
#> Kappa.1      -45.33624360  1735.0139499   11.0771130  4427.1500892
#> Kappa.2      153.99069737  -335.6724385  102.3780574 -1135.9936924
#> Kappa.3      100.08945981 -1491.8846153  111.7788657 -3817.0902260
#> Kappa.4      129.02591622  -219.1995442   98.8287649  -555.9617184
#> Estate.1    -111.88350870  -179.6770549 -152.9607189    27.3000461
#> Estate.2      94.03317072    96.3091709  100.7001979   -81.3413966
#> Estate.3       2.80217882     7.8257865  -13.9792355    13.3291088
#> MEDV.11      -53.24689114  -277.8874903  -35.6318866  -612.5467413
#> MEDV.12     -247.09542450  -975.9419476 -134.0221212 -2060.9465833
#> MEDV.13       32.06605113    53.3484174   50.8821432    27.0280334
#> MEDV.22     -386.38476179  -792.8119308   12.1947335 -1193.4903903
#> MEDV.23      -57.40787236   -74.0420858  -48.2582718   -48.3447863
#> MEDV.33       -5.01170623    -9.5648376   -5.7029333   -10.3127945
#>                     [,38]         [,39]         [,40]         [,41]
#> (Intercept)  3.527491e-02 -9.760289e-02  7.941712e-02  4.096657e-02
#> Chi.P.0     -4.227759e+02 -3.978046e+02 -3.699562e+02 -3.074850e+02
#> Chi.P.1     -7.411680e+02 -5.925364e+02 -6.404063e+02 -5.835303e+02
#> Chi.P.2      2.648431e+03  2.376660e+03  2.701391e+03  2.163873e+03
#> Chi.P.3      1.667406e+03  1.424926e+03  1.851349e+03  1.420741e+03
#> Chi.P.4     -3.745816e+00 -5.903264e+00 -4.665849e+00 -6.401683e+00
#> Chi.P.5      3.241965e+02  2.690080e+02  3.650541e+02  2.994062e+02
#> Chi.C.3      3.922324e+01  2.994118e+01  4.572809e+01  3.840665e+01
#> Chi.PC.4    -1.819579e+02 -1.541339e+02 -1.934229e+02 -1.366766e+02
#> Kappa.1      2.746699e+03  2.000935e+03  3.461368e+03  1.845280e+03
#> Kappa.2     -7.207625e+02 -5.890575e+02 -8.406933e+02 -4.887910e+02
#> Kappa.3     -2.461550e+03 -1.835095e+03 -2.985926e+03 -1.684616e+03
#> Kappa.4     -3.841057e+02 -3.870069e+02 -4.248117e+02 -4.659561e+02
#> Estate.1    -9.878443e+01 -9.659795e+01 -6.338571e+01 -3.423596e+01
#> Estate.2     3.133129e+01  3.518980e+01 -1.041128e+01  3.336558e+00
#> Estate.3     1.206619e+01  8.475695e+00  1.516486e+01  1.016640e+01
#> MEDV.11     -4.092655e+02 -2.997993e+02 -4.948313e+02 -2.934326e+02
#> MEDV.12     -1.408074e+03 -1.087670e+03 -1.649829e+03 -1.036457e+03
#> MEDV.13      4.338935e+01  4.524277e+01  1.994096e+01  2.148198e+01
#> MEDV.22     -1.019764e+03 -8.419985e+02 -1.228476e+03 -8.738762e+02
#> MEDV.23     -5.230722e+01 -4.727508e+01 -4.633638e+01 -3.651183e+01
#> MEDV.33     -9.542370e+00 -8.082226e+00 -8.223452e+00 -6.552248e+00
#>                     [,42]        [,43]         [,44]        [,45]         [,46]
#> (Intercept)     0.1216031    0.1317013   -0.03903687   -0.2069613   -0.04212005
#> Chi.P.0      -554.0727982   83.5302097  132.25660174  142.9079058   97.51323356
#> Chi.P.1     -1241.8190187   85.6522088  144.41968017  159.9175489   99.76738189
#> Chi.P.2      3811.3298809   80.7597311  103.71176709   91.3980818   92.53738158
#> Chi.P.3      2435.1196003  119.4689328  441.18333554  417.9325318  155.35375943
#> Chi.P.4        -6.0030112   -9.4376675   -8.10261829   -4.9608351   -7.02285328
#> Chi.P.5       475.1913451   70.5039245  114.99666033  128.6302818   53.67556282
#> Chi.C.3        56.0185456   23.1213803   16.47948997   22.6782570   12.44743781
#> Chi.PC.4     -260.1232103   13.2975313  -57.62289244  -21.7414287  -16.84900405
#> Kappa.1      4120.2977843   -3.9165062 -112.36741599 -147.1000565   -5.03928700
#> Kappa.2     -1258.4294538   93.1247361  179.74741977  203.5065532  108.43190729
#> Kappa.3     -3700.6441225   74.7131076  132.73316701  101.7659487   94.33536614
#> Kappa.4      -680.1030934   85.0561485  138.85943539  149.6674688   99.01366891
#> Estate.1       60.0984941 -166.5700152 -134.22408269 -155.4289264 -216.48099919
#> Estate.2      -67.5647734  112.7460363  119.06546398  131.3166826  155.21405035
#> Estate.3       19.9436698  -16.4353437    7.59081245    7.1592941  -13.97428918
#> MEDV.11      -575.8218639  -28.9239577  -46.69862600  -29.6025572  -29.57000136
#> MEDV.12     -2021.9304587 -113.2813889 -268.15892749 -224.9202971 -124.18715546
#> MEDV.13        20.4292162   34.7142759   24.44193465   12.4432428   53.18429378
#> MEDV.22     -1404.1473508   41.5492946 -482.28858016 -485.6606308    1.41904679
#> MEDV.23       -42.6534448  -32.1349590  -53.97834632  -26.1504743  -47.62323967
#> MEDV.33        -9.6933299   -4.3007451   -4.92915602   -3.4507635   -5.95598909
#>                   [,47]        [,48]         [,49]        [,50]
#> (Intercept)    0.117542    0.2551899   -0.04864663    0.1748471
#> Chi.P.0       74.953564   60.0169813  122.49471068  149.1347606
#> Chi.P.1       74.798386   60.5046895  133.50509818  161.6015884
#> Chi.P.2       74.630060   60.0919291   96.32767441  155.4413408
#> Chi.P.3      106.962955   66.3098471  368.05040339  264.2659001
#> Chi.P.4      -12.217467   -8.0551736  -10.32921455   -4.5268018
#> Chi.P.5       45.973672  101.8648266  152.41618787   80.6692679
#> Chi.C.3       13.648245   31.3234341   35.67606030   15.1490422
#> Chi.PC.4      -6.070574   59.4203671   19.68266305  -10.5927961
#> Kappa.1       22.717928    1.3029197 -118.48230022  -98.1162282
#> Kappa.2       74.651180   65.5196268  176.30429739  201.9939400
#> Kappa.3       96.928180   57.1304842   44.81877690   83.1975941
#> Kappa.4       75.133121   60.6115372  128.79186017  157.6030483
#> Estate.1     -96.265517  -11.7552481 -157.38589996 -131.4041603
#> Estate.2      69.390787   29.4843640  109.41577468   88.3252735
#> Estate.3     -14.139688  -17.7399959    4.41274924    2.8043367
#> MEDV.11      -28.137706  -30.6633977  -28.25917074  -35.1421234
#> MEDV.12     -111.338575 -102.2684501 -222.79338286 -218.2584888
#> MEDV.13       31.515504    7.3295627   -3.17075462   24.7310368
#> MEDV.22       91.200513   92.4487648 -400.71699241 -398.5926321
#> MEDV.23      -27.640650  -22.0163460   -8.33051684  -40.4245643
#> MEDV.33       -3.902694   -2.3021959   -1.94837121   -4.9165147
predict(fit, newx = x)
#>   [1] -2126.5311149 -2113.0093937 -1927.1295697 -1916.2804337 -1727.1257914
#>   [6] -1717.2861309 -1526.7736460 -1517.4430975 -1326.3146437 -1317.1910812
#>  [11] -1126.0258379 -1117.0438757 -1152.3975759  -925.8548082  -916.9989473
#>  [16]  -954.1374578  -725.7659218  -716.9434414  -755.6424904  -525.7590496
#>  [21]  -517.1505849  -556.8416774  -326.0251851  -317.2390446  -358.0961928
#>  [26]  -126.3457723  -117.6196787  -159.3368486    73.2671789    81.9582476
#>  [31]    68.2290319    58.7176607    52.4873494    48.9405839    40.1698496
#>  [36]    39.5149932   272.8277268   281.5151093   267.8361441   258.2372266
#>  [41]   251.9653404   239.4227669   238.3654502   472.3130087   481.0699828
#>  [46]   437.1884684  -682.5094818  -608.1175625  -484.6798508  -484.3143131
#>  [51]  -508.3176221  -505.3749894  -520.2682549  -385.5998415  -397.4439854
#>  [56]  -408.4523457  -416.1592035  -420.4766160  -281.4831352  -286.1063903
#>  [61]  -309.2137607  -308.3213818  -301.3503366  -320.1517588  -185.9565051
#>  [66]  -195.1106277  -198.7931094  -209.8496502  -219.9637066   -81.9124664
#>  [71]   -87.2036280  -110.5932894  -108.9750042  -119.9249612    13.6476094
#>  [76]     4.3117217     2.5946491    18.1035220     0.5851557   -17.6388530
#>  [81]   117.6039740   111.9434372   111.4492271    88.5420984    88.2353049
#>  [86]    77.1328057    73.1799456   207.1877133   201.0384884   181.6989939
#>  [91]   173.3376435   174.8722633   165.2800101   314.5310378   310.4992541
#>  [96]   287.0201457   287.3510251   277.2610142   272.4059470   403.2120572
#> [101]   396.4112736   381.0383589   372.5500114   369.5983754   364.1443016
#> [106]   516.5316903   509.6152424   488.2655674   486.0172123   476.1631999
#> [111]   471.7934591   600.6166529   585.7038417   567.3884202   708.7957250
#> [116]   687.7425623   685.0436497   667.1045429   784.7919483  -567.7315248
#> [121]  -479.6098697  -369.2487971  -253.1174236  -170.8220567   -54.8236146
#> [126]   -84.0919337     8.9308102   145.1456488   114.2970928   104.2542687
#> [131]    94.5219366   229.0643266   223.3487825   206.8911548   192.5342649
#> [136]   345.1790929   312.6753527   302.1940665   292.1412858   428.0533607
#> [141]   426.9877038   405.1950674   397.4111318   390.0165622   544.2987487
#> [146]   514.4917053   501.0570061   488.5117777   491.8639636   627.1276743
#> [151]   596.2499814   586.9544253   743.3819695   710.2080283   702.3023194
#> [156]   685.8241370   784.5182155   908.9330637   883.6716410   983.0990826
#> [161]   -28.4165088   169.0372926   152.5673765   368.6349914   351.6020516
#> [166]   567.6171550   525.1185800   518.3042363   517.9979174   632.6161648
#> [171]   620.4427871   615.5397536   766.5900204   723.4222502   716.2633675
#> [176]   714.9335090   813.3049698  -340.6341624  -150.8368988  -917.2043616
#> [181]  -683.6380166  -481.0675768  -508.8049655  -398.1200985  -414.9297846
#> [186]  -309.3802100  -321.2695870  -328.2182144  -197.9164950  -110.0036170
#> [191]    79.2609847    74.3714838   203.7678983   401.2795480   380.9431320
#> [196]  -251.5274498  -166.1719643  -100.6229019   116.3040612   103.4325476
#> [201]    97.1834530   320.0317613   302.5906622   295.4300953   406.5668699
#> [206]   406.0812741   392.4233534