Some questions on this homework involve random sampling, and so each student may obtain slightly different results. Because of this, I need to see both your code and resulting output. For simplicity and to ensure that your output matches your textual explanations and answers, I will accept copies of your output placed in Microsoft Word for this assignment. However if you feel more comfortable doing so, you can also alternatively submit an HTML document produced in R Markdown. Just be sure that the HTML document displays your output and that your written answers match the displayed output. Use the penguins2 excel file to answer all of the questions in this homework.
library(readxl)
penguins2 <- read_excel("C:/Users/Lynx/Documents/MSDA/621/penguins2.xlsx")
str(penguins2)
## tibble [344 × 7] (S3: tbl_df/tbl/data.frame)
## $ species : chr [1:344] "Adelie" "Adelie" "Adelie" "Adelie" ...
## $ island : chr [1:344] "Torgersen" "Torgersen" "Torgersen" "Torgersen" ...
## $ bill_length_mm : num [1:344] 39.1 39.5 40.3 NA 36.7 39.3 38.9 39.2 34.1 42 ...
## $ bill_depth_mm : num [1:344] 18.7 17.4 18 NA 19.3 20.6 17.8 19.6 18.1 20.2 ...
## $ flipper_length_mm: num [1:344] 181 186 195 NA 193 190 181 195 193 190 ...
## $ body_mass_g : num [1:344] 3750 3800 3250 NA 3450 ...
## $ year : num [1:344] 2007 2007 2007 2007 2007 ...
sum(is.na(penguins2))
## [1] 8
penguins2$bill_length_mm[is.na(penguins2$bill_length_mm)] <- mean(penguins2$bill_length_mm, na.rm = T)
penguins2$bill_depth_mm[is.na(penguins2$bill_depth_mm)] <- mean(penguins2$bill_depth_mm, na.rm = T)
penguins2$flipper_length_mm[is.na(penguins2$flipper_length_mm)] <- mean(penguins2$flipper_length_mm, na.rm = T)
penguins2$body_mass_g[is.na(penguins2$body_mass_g)] <- mean(penguins2$body_mass_g, na.rm = T)
sum(is.na(penguins2))
## [1] 0
penguins2$species <- as.factor(penguins2$species)
penguins2$island <- as.factor(penguins2$island)
str(penguins2)
## tibble [344 × 7] (S3: tbl_df/tbl/data.frame)
## $ species : Factor w/ 3 levels "Adelie","Chinstrap",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ island : Factor w/ 3 levels "Biscoe","Dream",..: 3 3 3 3 3 3 3 3 3 3 ...
## $ bill_length_mm : num [1:344] 39.1 39.5 40.3 43.9 36.7 ...
## $ bill_depth_mm : num [1:344] 18.7 17.4 18 17.2 19.3 ...
## $ flipper_length_mm: num [1:344] 181 186 195 201 193 ...
## $ body_mass_g : num [1:344] 3750 3800 3250 4202 3450 ...
## $ year : num [1:344] 2007 2007 2007 2007 2007 ...
index <- sample(nrow(penguins2), nrow(penguins2)*0.90)
penguins_train <- penguins2[index,]
penguins_test <- penguins2[-index,]
library(gbm)
## Loaded gbm 2.1.8.1
penguins_boost <- gbm(formula = body_mass_g~., data=penguins_train, distribution = "gaussian", n.trees = 10000, shrinkage = 0.01, interaction.depth = 3)
summary(penguins_boost)
## var rel.inf
## flipper_length_mm flipper_length_mm 41.688221
## bill_length_mm bill_length_mm 18.075535
## species species 17.123448
## bill_depth_mm bill_depth_mm 17.041759
## island island 3.142824
## year year 2.928213
a) Does it make more sense to use the training set or testing set when developing this model?
The training set is used to fit the model parameters whereas the testing set is used to evaluate the best model. As such, it would make more sense to use the training set in developing the model.
b) Which covariate is most influential in your predictive model? In answering this question, be sure to provide your output from your code listing the relative influence of each covariate.
flipper_length_mm is the most influential covariate based upon the prediction model above.
c) Create a graph displaying the relationship (as determined in your model) between the target variable and the most influential covariate.
plot(body_mass_g ~ flipper_length_mm, data=penguins2)
d) Use the testing set to calculate your model’s mean squared error (MSE).
penguins_boost_pred_test <- predict(penguins_boost, penguins_test, n.trees = 10000)
mean((penguins_test$body_mass_g - penguins_boost_pred_test)^2)
## [1] 150442.3
e) Create a graph displaying the test MSE when various amounts of trees are used in the boosting model. Based on this graph, could the MSE be improved by using a smaller number of trees? Be sure to provide the instructor with all output produced by your code.
ntree <- seq(100, 10000, 100)
predmat <- predict(penguins_boost, newdata = penguins_test, n.trees = ntree)
predmat
## 100 200 300 400 500 600 700 800
## [1,] 3950.102 3945.775 3998.232 4047.478 4073.936 4086.896 4108.481 4113.297
## [2,] 3797.544 3669.579 3636.408 3602.771 3587.392 3582.886 3571.112 3580.659
## [3,] 3972.168 3976.002 4034.660 4085.552 4116.635 4124.200 4141.724 4147.015
## [4,] 3805.792 3694.611 3686.473 3696.105 3724.128 3734.874 3754.362 3774.338
## [5,] 3811.731 3694.696 3674.635 3674.632 3694.020 3709.112 3737.714 3761.602
## [6,] 3882.015 3793.130 3781.238 3783.266 3778.232 3757.696 3757.530 3761.172
## [7,] 3882.015 3795.391 3779.401 3787.098 3780.741 3767.863 3773.786 3781.128
## [8,] 4054.087 4080.878 4177.474 4236.406 4276.338 4306.350 4350.895 4369.101
## [9,] 3906.092 3846.474 3876.621 3891.829 3917.161 3926.753 3942.724 3952.617
## [10,] 3692.421 3471.374 3349.927 3311.584 3284.155 3271.837 3257.642 3252.044
## [11,] 3887.954 3819.064 3842.761 3857.053 3880.990 3884.046 3897.134 3907.348
## [12,] 3834.391 3660.075 3574.164 3540.580 3533.996 3511.674 3499.882 3492.966
## [13,] 3828.080 3657.888 3579.179 3555.388 3552.363 3547.468 3555.042 3563.528
## [14,] 4186.827 4233.965 4295.819 4329.546 4358.807 4361.088 4373.250 4378.170
## [15,] 3892.424 3776.880 3745.781 3727.273 3721.115 3710.374 3716.807 3711.931
## [16,] 4037.470 4026.273 4075.051 4075.049 4053.701 4026.086 4005.408 3992.745
## [17,] 3842.509 3702.752 3651.524 3610.720 3581.269 3558.482 3544.497 3538.174
## [18,] 3742.233 3519.564 3408.480 3366.010 3343.214 3325.809 3315.649 3311.191
## [19,] 5038.095 5365.990 5540.409 5663.988 5719.874 5759.322 5785.060 5813.975
## [20,] 4520.226 4628.767 4680.587 4711.589 4723.111 4726.415 4737.585 4750.945
## [21,] 4860.903 5121.179 5258.749 5348.973 5395.523 5436.803 5451.048 5484.219
## [22,] 4467.047 4564.461 4626.454 4678.198 4700.962 4728.545 4734.366 4757.057
## [23,] 5030.721 5346.472 5499.964 5584.742 5625.980 5646.721 5666.951 5682.803
## [24,] 4655.237 4808.435 4816.771 4796.352 4783.148 4755.062 4715.926 4693.373
## [25,] 4366.586 4437.725 4477.719 4487.983 4490.813 4488.683 4482.175 4484.288
## [26,] 4592.871 4732.180 4735.981 4727.766 4731.866 4725.460 4727.147 4727.156
## [27,] 4739.956 4933.158 4973.089 4968.530 4956.493 4933.969 4897.349 4882.653
## [28,] 4975.465 5257.257 5378.981 5441.492 5448.678 5439.985 5437.830 5424.111
## [29,] 4518.877 4655.381 4724.858 4734.826 4736.958 4750.068 4757.060 4757.965
## [30,] 4859.134 5105.970 5188.954 5209.647 5194.891 5186.968 5178.199 5153.603
## [31,] 5005.275 5308.729 5431.634 5475.339 5497.321 5508.326 5513.119 5522.867
## [32,] 4004.486 3913.956 3881.468 3859.778 3868.275 3875.003 3886.913 3892.008
## [33,] 3774.534 3599.678 3508.201 3463.739 3445.931 3449.803 3452.258 3455.566
## [34,] 3961.167 3889.737 3834.085 3794.272 3770.216 3764.780 3756.869 3743.376
## [35,] 4004.486 3917.951 3876.064 3825.257 3794.290 3765.334 3752.042 3721.116
## 900 1000 1100 1200 1300 1400 1500 1600
## [1,] 4111.840 4102.719 4119.395 4119.226 4116.980 4123.447 4131.211 4128.760
## [2,] 3578.904 3584.698 3580.688 3584.706 3588.301 3604.361 3609.406 3613.173
## [3,] 4137.105 4130.954 4142.281 4146.795 4148.552 4149.273 4146.154 4145.246
## [4,] 3774.097 3785.461 3781.146 3778.193 3776.929 3789.936 3790.856 3793.372
## [5,] 3774.818 3795.380 3796.937 3801.225 3804.556 3805.888 3814.135 3823.969
## [6,] 3761.746 3758.077 3759.779 3750.294 3743.878 3750.032 3741.961 3741.023
## [7,] 3776.386 3771.645 3766.463 3753.729 3742.646 3735.682 3733.257 3733.486
## [8,] 4388.786 4407.803 4427.805 4446.217 4434.479 4438.302 4453.230 4458.650
## [9,] 3948.178 3952.980 3963.263 3964.243 3957.548 3960.748 3956.094 3953.530
## [10,] 3248.118 3253.072 3246.657 3248.099 3243.017 3244.524 3235.929 3240.906
## [11,] 3910.105 3915.985 3918.948 3919.200 3926.572 3934.804 3932.657 3933.831
## [12,] 3486.380 3490.189 3489.500 3493.444 3498.960 3500.572 3501.001 3502.991
## [13,] 3557.820 3574.610 3586.653 3591.579 3591.270 3595.430 3595.791 3606.879
## [14,] 4387.468 4389.701 4396.599 4399.359 4396.959 4396.299 4401.602 4400.811
## [15,] 3703.548 3701.246 3699.295 3688.245 3679.087 3673.742 3669.645 3662.501
## [16,] 3986.725 3975.223 3953.193 3945.157 3933.128 3912.104 3916.336 3903.053
## [17,] 3519.552 3513.040 3509.759 3506.099 3499.932 3491.569 3486.828 3495.279
## [18,] 3294.241 3298.097 3298.200 3293.536 3290.952 3293.024 3290.537 3288.778
## [19,] 5819.293 5831.019 5835.988 5843.718 5868.069 5872.908 5866.831 5883.322
## [20,] 4756.395 4756.205 4757.121 4749.911 4753.405 4755.883 4756.727 4752.996
## [21,] 5487.585 5489.502 5500.890 5516.920 5525.842 5531.462 5539.428 5540.408
## [22,] 4764.473 4770.739 4785.002 4798.755 4804.884 4805.900 4817.498 4811.354
## [23,] 5685.770 5691.761 5695.709 5692.005 5709.614 5715.971 5707.992 5718.386
## [24,] 4678.598 4662.794 4649.057 4640.695 4631.881 4624.709 4619.821 4622.608
## [25,] 4480.021 4479.804 4479.662 4482.581 4487.123 4490.807 4496.126 4500.025
## [26,] 4720.184 4723.782 4727.266 4717.464 4719.222 4719.134 4717.692 4722.283
## [27,] 4874.661 4862.227 4846.510 4840.260 4833.121 4830.742 4823.619 4828.270
## [28,] 5419.368 5411.510 5401.343 5396.307 5399.879 5391.653 5390.783 5391.469
## [29,] 4760.426 4761.220 4772.643 4777.700 4774.080 4772.865 4785.903 4782.705
## [30,] 5148.717 5138.703 5133.037 5121.355 5116.262 5107.752 5104.039 5099.654
## [31,] 5521.149 5526.810 5524.135 5527.289 5530.635 5528.371 5532.749 5534.429
## [32,] 3892.894 3891.785 3899.079 3907.098 3911.361 3905.924 3911.107 3909.909
## [33,] 3453.075 3447.587 3450.545 3447.306 3451.708 3450.792 3448.611 3443.410
## [34,] 3739.895 3732.863 3732.331 3733.636 3728.456 3716.316 3712.779 3702.003
## [35,] 3719.689 3709.986 3698.051 3687.833 3689.308 3662.923 3646.902 3638.074
## 1700 1800 1900 2000 2100 2200 2300 2400
## [1,] 4124.877 4120.462 4126.331 4133.071 4133.976 4129.906 4138.902 4135.681
## [2,] 3601.589 3607.536 3612.414 3627.308 3634.567 3630.946 3637.991 3644.473
## [3,] 4140.302 4134.143 4144.430 4147.823 4144.816 4143.729 4150.794 4149.090
## [4,] 3787.780 3786.680 3779.388 3786.531 3789.572 3778.170 3781.587 3783.704
## [5,] 3827.569 3828.593 3833.472 3852.501 3860.212 3858.865 3862.821 3862.685
## [6,] 3739.146 3733.681 3730.032 3731.863 3740.430 3736.082 3728.524 3735.236
## [7,] 3735.869 3725.508 3720.073 3727.298 3733.990 3727.684 3716.102 3712.096
## [8,] 4477.440 4476.010 4476.083 4483.145 4493.299 4495.996 4504.243 4508.325
## [9,] 3956.391 3952.915 3949.045 3947.092 3942.400 3934.344 3934.549 3929.602
## [10,] 3231.671 3235.116 3227.214 3223.236 3222.990 3212.105 3216.314 3220.895
## [11,] 3932.945 3937.553 3935.904 3939.162 3941.485 3937.246 3936.597 3941.552
## [12,] 3500.830 3494.364 3485.081 3476.313 3484.697 3478.240 3466.632 3472.031
## [13,] 3611.431 3612.384 3620.137 3628.096 3626.003 3632.006 3639.595 3638.118
## [14,] 4412.608 4412.283 4414.729 4416.385 4422.274 4429.184 4418.421 4426.664
## [15,] 3656.220 3658.162 3653.933 3638.176 3634.950 3635.086 3635.830 3625.707
## [16,] 3903.861 3899.914 3889.342 3874.733 3873.457 3872.138 3856.848 3858.207
## [17,] 3487.474 3484.764 3480.051 3477.687 3474.343 3469.930 3465.834 3454.063
## [18,] 3287.468 3289.664 3296.429 3297.098 3299.182 3301.909 3302.336 3300.470
## [19,] 5886.230 5881.237 5888.735 5888.510 5889.954 5896.010 5903.244 5908.633
## [20,] 4748.866 4743.493 4742.031 4742.365 4742.409 4742.625 4735.220 4734.343
## [21,] 5544.348 5541.856 5535.487 5539.983 5537.461 5540.248 5541.412 5539.237
## [22,] 4805.917 4799.224 4800.479 4802.729 4798.909 4803.041 4800.474 4796.276
## [23,] 5718.545 5714.443 5721.780 5716.164 5713.903 5721.528 5724.779 5729.273
## [24,] 4608.661 4603.801 4594.555 4598.349 4589.091 4592.101 4590.327 4581.748
## [25,] 4495.501 4492.538 4500.170 4502.846 4494.468 4501.398 4504.771 4506.185
## [26,] 4718.048 4717.136 4715.056 4723.939 4722.693 4725.474 4720.851 4720.001
## [27,] 4813.861 4814.032 4808.187 4812.956 4804.232 4806.666 4806.423 4799.814
## [28,] 5388.755 5379.528 5380.054 5380.537 5374.952 5376.671 5382.986 5381.741
## [29,] 4783.645 4781.308 4784.843 4781.591 4771.433 4775.015 4776.463 4778.383
## [30,] 5095.128 5080.606 5078.122 5077.981 5071.924 5070.145 5067.125 5054.172
## [31,] 5536.413 5544.481 5534.751 5527.264 5522.709 5528.134 5531.657 5530.874
## [32,] 3917.007 3919.612 3918.227 3924.907 3926.556 3926.685 3925.333 3928.865
## [33,] 3444.983 3451.598 3455.134 3459.576 3463.631 3462.863 3464.846 3476.092
## [34,] 3715.149 3710.804 3712.108 3711.101 3711.847 3713.267 3710.356 3713.837
## [35,] 3638.553 3630.482 3621.267 3612.056 3609.134 3605.399 3586.591 3586.674
## 2500 2600 2700 2800 2900 3000 3100 3200
## [1,] 4136.657 4132.677 4130.777 4126.663 4130.817 4125.641 4126.784 4125.967
## [2,] 3649.632 3646.889 3642.687 3636.783 3640.693 3645.682 3653.345 3654.037
## [3,] 4153.526 4149.233 4154.538 4161.508 4173.857 4175.265 4183.008 4183.549
## [4,] 3789.089 3793.233 3792.203 3790.438 3791.023 3799.220 3797.000 3798.082
## [5,] 3870.026 3878.870 3886.067 3882.758 3885.551 3893.777 3898.627 3893.816
## [6,] 3739.824 3732.489 3729.053 3726.582 3729.199 3723.684 3724.062 3718.095
## [7,] 3711.712 3712.082 3708.594 3705.643 3704.932 3700.466 3699.091 3692.724
## [8,] 4517.543 4516.576 4529.291 4526.548 4530.963 4536.105 4546.704 4549.557
## [9,] 3930.429 3930.393 3937.120 3928.515 3931.591 3933.815 3932.219 3933.384
## [10,] 3216.590 3215.693 3209.011 3207.518 3208.487 3216.544 3207.337 3201.504
## [11,] 3947.558 3943.507 3945.208 3937.346 3942.451 3935.786 3935.460 3931.792
## [12,] 3471.514 3474.355 3459.782 3452.904 3450.940 3442.693 3440.143 3433.123
## [13,] 3635.982 3638.594 3643.682 3642.607 3639.069 3645.882 3652.781 3655.438
## [14,] 4431.704 4434.557 4444.823 4443.107 4442.738 4441.078 4445.191 4453.359
## [15,] 3621.492 3626.116 3630.759 3628.784 3630.805 3625.295 3627.394 3623.531
## [16,] 3855.702 3850.316 3853.214 3846.198 3847.588 3840.151 3830.901 3838.140
## [17,] 3454.318 3454.382 3451.654 3446.933 3448.535 3440.433 3432.134 3432.742
## [18,] 3297.027 3302.330 3306.786 3306.413 3304.315 3307.283 3311.595 3314.019
## [19,] 5911.313 5912.793 5927.278 5926.399 5932.104 5934.359 5934.416 5936.423
## [20,] 4738.572 4732.473 4736.455 4736.056 4731.963 4725.655 4719.501 4716.152
## [21,] 5538.474 5535.103 5536.016 5531.805 5533.486 5542.468 5542.647 5545.960
## [22,] 4798.207 4789.939 4780.934 4772.939 4770.686 4778.939 4766.603 4766.530
## [23,] 5728.371 5726.007 5738.588 5735.468 5744.071 5745.436 5747.854 5749.509
## [24,] 4567.960 4572.897 4565.362 4568.372 4566.061 4565.722 4567.641 4560.347
## [25,] 4509.665 4512.546 4516.234 4518.416 4510.637 4513.755 4509.333 4513.133
## [26,] 4717.819 4714.212 4708.841 4714.205 4718.829 4717.252 4722.378 4716.651
## [27,] 4787.568 4796.700 4798.422 4804.220 4798.452 4798.256 4796.319 4796.381
## [28,] 5383.660 5383.706 5393.772 5390.155 5386.981 5387.346 5377.435 5374.430
## [29,] 4779.778 4777.809 4776.460 4768.910 4767.182 4770.983 4766.412 4766.451
## [30,] 5051.010 5041.368 5037.102 5030.332 5022.996 5021.657 5010.820 5004.991
## [31,] 5527.460 5521.422 5530.683 5526.454 5533.157 5533.213 5533.795 5536.545
## [32,] 3927.677 3931.335 3927.034 3927.030 3922.713 3923.372 3914.084 3907.686
## [33,] 3478.515 3470.939 3470.106 3469.489 3466.224 3472.520 3473.542 3470.383
## [34,] 3718.078 3714.392 3715.302 3720.663 3724.939 3725.211 3732.311 3735.512
## [35,] 3580.224 3576.196 3565.850 3573.144 3569.989 3561.695 3560.275 3562.602
## 3300 3400 3500 3600 3700 3800 3900 4000
## [1,] 4131.140 4134.606 4142.233 4139.550 4153.107 4148.822 4152.155 4151.821
## [2,] 3663.302 3665.161 3673.623 3677.555 3681.761 3681.886 3681.167 3686.273
## [3,] 4193.627 4199.847 4201.357 4204.756 4218.532 4214.672 4207.534 4212.951
## [4,] 3802.080 3804.976 3808.403 3807.108 3809.235 3804.072 3804.892 3800.197
## [5,] 3908.047 3907.837 3915.202 3913.810 3914.090 3917.567 3916.980 3912.228
## [6,] 3722.504 3714.847 3716.698 3716.574 3714.735 3719.845 3723.901 3721.903
## [7,] 3699.255 3691.585 3692.867 3690.085 3686.860 3686.151 3690.504 3684.340
## [8,] 4548.859 4552.732 4559.508 4558.064 4560.445 4560.778 4560.552 4563.402
## [9,] 3927.295 3925.625 3930.843 3926.934 3931.984 3933.102 3928.691 3927.293
## [10,] 3194.054 3193.385 3185.112 3193.243 3187.257 3185.015 3179.670 3171.952
## [11,] 3926.450 3923.427 3932.368 3927.149 3926.279 3928.299 3934.024 3932.178
## [12,] 3424.939 3421.171 3410.059 3414.961 3408.254 3405.120 3417.275 3407.902
## [13,] 3661.473 3660.200 3657.570 3665.550 3665.937 3662.245 3660.469 3654.453
## [14,] 4450.882 4447.278 4453.764 4450.832 4449.858 4452.196 4454.262 4451.986
## [15,] 3617.375 3614.521 3607.447 3610.750 3610.634 3613.020 3610.319 3608.984
## [16,] 3828.063 3817.753 3818.723 3816.551 3813.979 3814.271 3809.428 3812.056
## [17,] 3433.993 3435.119 3441.423 3442.734 3445.644 3445.966 3443.096 3436.629
## [18,] 3321.203 3320.250 3316.050 3320.036 3325.324 3319.727 3312.450 3311.655
## [19,] 5940.365 5944.160 5948.313 5954.645 5956.329 5960.574 5957.994 5962.640
## [20,] 4718.505 4719.288 4718.278 4708.651 4703.656 4704.041 4704.392 4699.377
## [21,] 5553.645 5545.632 5549.538 5552.851 5554.871 5554.564 5557.677 5560.586
## [22,] 4766.644 4760.793 4757.406 4759.265 4758.895 4763.798 4763.398 4760.836
## [23,] 5751.972 5755.592 5756.846 5763.843 5762.519 5765.507 5762.871 5760.803
## [24,] 4560.050 4558.556 4559.478 4551.629 4546.824 4547.584 4549.529 4543.137
## [25,] 4513.971 4515.361 4517.566 4505.770 4500.869 4503.870 4504.768 4496.112
## [26,] 4717.934 4718.759 4716.000 4709.274 4707.720 4712.583 4713.835 4714.359
## [27,] 4798.050 4797.259 4799.261 4790.876 4784.343 4785.153 4787.367 4777.530
## [28,] 5376.870 5375.557 5369.506 5371.032 5374.847 5369.441 5367.176 5365.584
## [29,] 4765.349 4756.119 4748.622 4750.793 4755.425 4756.654 4752.997 4755.353
## [30,] 5006.392 4998.965 4995.233 4986.395 4987.251 4971.524 4975.273 4975.934
## [31,] 5540.791 5534.986 5538.485 5551.042 5552.571 5558.398 5558.129 5558.086
## [32,] 3908.922 3913.884 3916.199 3917.271 3913.700 3916.071 3924.047 3930.945
## [33,] 3473.735 3474.603 3476.517 3475.341 3474.196 3474.028 3475.648 3474.974
## [34,] 3746.757 3745.206 3748.653 3741.576 3741.751 3741.911 3740.496 3741.947
## [35,] 3565.948 3556.593 3552.524 3552.075 3548.985 3549.304 3550.765 3552.771
## 4100 4200 4300 4400 4500 4600 4700 4800
## [1,] 4149.474 4146.517 4149.651 4146.637 4150.045 4145.956 4149.108 4151.068
## [2,] 3693.382 3694.391 3702.869 3700.355 3705.931 3711.744 3715.562 3714.485
## [3,] 4213.921 4206.652 4211.044 4210.006 4218.031 4216.799 4216.644 4214.129
## [4,] 3802.126 3805.603 3809.325 3807.700 3809.939 3809.137 3810.145 3824.258
## [5,] 3913.011 3910.170 3920.884 3916.566 3923.398 3930.166 3925.255 3933.166
## [6,] 3729.516 3725.923 3721.214 3711.077 3709.786 3707.030 3714.895 3715.665
## [7,] 3694.340 3691.508 3690.557 3680.124 3684.780 3684.644 3687.129 3681.284
## [8,] 4562.016 4567.405 4570.668 4580.796 4580.702 4585.280 4586.677 4582.847
## [9,] 3930.293 3925.355 3918.232 3918.666 3919.519 3923.694 3922.515 3917.996
## [10,] 3182.275 3184.781 3186.021 3194.304 3193.919 3190.015 3190.657 3190.359
## [11,] 3930.796 3932.828 3926.284 3921.439 3917.736 3919.085 3922.391 3922.693
## [12,] 3403.700 3400.799 3397.618 3398.036 3390.463 3385.036 3378.534 3382.848
## [13,] 3653.191 3646.362 3649.028 3655.728 3662.552 3667.729 3663.533 3662.635
## [14,] 4447.175 4448.934 4443.452 4445.649 4444.968 4445.875 4445.965 4453.685
## [15,] 3615.480 3605.011 3599.830 3610.222 3610.566 3617.503 3613.373 3611.049
## [16,] 3810.110 3801.009 3793.607 3788.805 3784.188 3788.255 3785.225 3793.503
## [17,] 3435.784 3427.343 3426.584 3425.397 3429.768 3432.875 3429.680 3436.619
## [18,] 3316.158 3314.966 3315.473 3324.593 3325.698 3327.565 3327.907 3323.246
## [19,] 5959.446 5966.796 5967.905 5966.463 5961.908 5970.657 5975.280 5975.344
## [20,] 4704.057 4693.302 4697.903 4692.188 4683.360 4682.956 4683.132 4682.346
## [21,] 5558.600 5557.505 5566.595 5561.569 5552.187 5550.563 5550.749 5553.749
## [22,] 4761.258 4754.593 4753.977 4753.168 4744.132 4743.667 4747.353 4748.963
## [23,] 5754.611 5764.888 5761.452 5759.360 5754.737 5761.259 5759.864 5757.594
## [24,] 4540.256 4541.944 4546.286 4548.437 4548.101 4545.251 4547.174 4541.289
## [25,] 4493.712 4495.513 4496.097 4493.136 4487.598 4488.797 4493.678 4493.897
## [26,] 4717.138 4712.581 4716.799 4716.416 4714.028 4706.945 4706.818 4702.399
## [27,] 4772.984 4780.244 4779.582 4782.330 4776.961 4771.865 4775.001 4768.646
## [28,] 5365.924 5375.697 5374.695 5375.866 5374.467 5376.970 5377.024 5378.893
## [29,] 4758.498 4765.181 4765.436 4767.825 4761.492 4763.025 4769.605 4776.465
## [30,] 4975.320 4976.013 4976.642 4973.322 4970.541 4963.783 4962.797 4966.218
## [31,] 5554.382 5558.462 5560.897 5555.126 5544.475 5544.027 5542.225 5539.947
## [32,] 3935.693 3930.784 3928.084 3928.176 3928.783 3941.225 3934.805 3930.219
## [33,] 3479.314 3477.515 3481.709 3474.342 3472.306 3474.887 3473.267 3466.136
## [34,] 3745.473 3746.737 3750.407 3749.807 3750.110 3747.443 3743.733 3738.359
## [35,] 3552.054 3557.464 3555.112 3551.657 3546.009 3551.637 3548.412 3545.537
## 4900 5000 5100 5200 5300 5400 5500 5600
## [1,] 4157.926 4157.009 4155.616 4159.030 4161.375 4160.018 4161.863 4166.133
## [2,] 3714.881 3724.559 3726.159 3720.367 3716.434 3721.607 3733.658 3734.196
## [3,] 4219.817 4219.972 4224.056 4234.878 4240.038 4239.386 4246.255 4248.906
## [4,] 3822.072 3820.555 3818.087 3815.443 3810.582 3812.310 3821.065 3827.245
## [5,] 3935.866 3942.100 3938.923 3935.770 3925.746 3922.399 3926.270 3929.416
## [6,] 3726.684 3728.651 3728.892 3722.821 3719.847 3717.559 3719.317 3723.221
## [7,] 3690.838 3692.344 3689.647 3685.900 3677.661 3673.508 3669.986 3673.282
## [8,] 4587.419 4583.562 4581.878 4581.933 4587.641 4585.415 4593.099 4605.004
## [9,] 3924.846 3921.176 3917.745 3916.307 3918.189 3918.161 3920.296 3920.709
## [10,] 3192.804 3191.926 3189.721 3187.521 3191.369 3196.421 3202.279 3201.836
## [11,] 3923.811 3915.520 3913.546 3912.669 3921.355 3920.170 3920.493 3927.794
## [12,] 3383.894 3381.128 3381.597 3378.853 3381.335 3374.766 3368.772 3358.805
## [13,] 3662.971 3667.192 3666.844 3661.122 3664.821 3663.402 3668.679 3670.753
## [14,] 4460.239 4458.534 4463.312 4458.997 4461.019 4452.920 4456.394 4454.899
## [15,] 3608.527 3607.875 3606.376 3595.247 3596.295 3595.620 3600.854 3599.218
## [16,] 3789.613 3783.903 3787.832 3778.201 3767.327 3759.903 3753.164 3748.739
## [17,] 3428.876 3430.728 3427.769 3422.511 3421.969 3419.129 3421.781 3416.600
## [18,] 3327.371 3335.043 3340.094 3335.218 3336.841 3337.316 3342.641 3343.065
## [19,] 5975.424 5972.307 5975.129 5978.867 5977.328 5977.265 5977.154 5979.982
## [20,] 4679.887 4675.248 4674.012 4672.013 4665.825 4665.582 4663.275 4665.984
## [21,] 5555.384 5549.276 5549.933 5548.172 5550.141 5546.180 5542.978 5536.549
## [22,] 4745.962 4741.385 4740.665 4738.504 4734.714 4737.515 4728.199 4722.939
## [23,] 5757.715 5753.929 5757.198 5758.252 5757.489 5761.184 5760.277 5758.371
## [24,] 4543.514 4543.160 4544.327 4544.328 4548.509 4542.487 4537.597 4546.051
## [25,] 4496.313 4496.199 4497.308 4497.487 4498.294 4492.853 4489.063 4489.481
## [26,] 4700.803 4698.388 4701.473 4701.594 4704.297 4706.535 4703.972 4709.788
## [27,] 4765.089 4766.292 4771.118 4768.571 4770.202 4767.764 4762.151 4772.215
## [28,] 5379.338 5376.275 5377.185 5378.800 5376.640 5379.915 5379.835 5381.807
## [29,] 4777.660 4774.526 4773.329 4773.846 4780.109 4777.080 4774.475 4769.973
## [30,] 4959.257 4953.776 4948.785 4945.067 4938.788 4937.580 4939.493 4934.545
## [31,] 5542.988 5541.672 5543.716 5542.828 5544.195 5544.593 5539.618 5535.603
## [32,] 3931.609 3934.896 3941.402 3942.048 3935.192 3941.063 3939.495 3936.182
## [33,] 3465.501 3467.549 3468.523 3473.170 3469.584 3470.360 3472.634 3469.684
## [34,] 3740.654 3740.333 3742.882 3745.776 3743.288 3740.621 3744.302 3747.204
## [35,] 3546.288 3548.015 3555.431 3554.427 3547.795 3544.753 3541.544 3535.195
## 5700 5800 5900 6000 6100 6200 6300 6400
## [1,] 4169.151 4166.679 4168.052 4175.411 4172.402 4177.166 4174.657 4172.248
## [2,] 3740.494 3736.949 3745.059 3745.989 3744.353 3744.164 3746.917 3752.137
## [3,] 4247.678 4248.292 4248.826 4255.335 4250.969 4254.652 4247.495 4244.599
## [4,] 3830.620 3831.222 3839.752 3839.699 3840.614 3844.545 3842.984 3845.099
## [5,] 3931.099 3932.970 3942.036 3938.436 3944.691 3946.929 3952.811 3952.989
## [6,] 3723.244 3719.171 3721.160 3720.257 3719.783 3722.300 3719.799 3723.911
## [7,] 3668.935 3663.817 3668.629 3667.083 3674.615 3677.056 3675.770 3680.429
## [8,] 4605.200 4603.269 4605.381 4615.242 4611.470 4609.877 4612.106 4610.063
## [9,] 3916.446 3914.313 3914.486 3911.814 3912.969 3916.012 3913.654 3909.337
## [10,] 3201.871 3195.390 3197.648 3195.793 3190.969 3189.951 3197.329 3197.089
## [11,] 3928.564 3930.061 3934.103 3934.646 3936.050 3940.322 3940.343 3936.759
## [12,] 3360.870 3353.074 3350.573 3346.220 3341.570 3338.056 3345.370 3334.177
## [13,] 3676.434 3675.319 3675.167 3669.266 3666.628 3666.900 3678.797 3674.760
## [14,] 4456.505 4455.253 4457.554 4457.256 4456.101 4457.660 4454.434 4462.263
## [15,] 3597.761 3597.660 3599.948 3594.445 3597.175 3597.051 3597.791 3590.098
## [16,] 3751.572 3752.976 3757.495 3760.980 3756.046 3756.172 3751.548 3752.256
## [17,] 3424.689 3427.530 3432.156 3426.268 3419.190 3419.539 3418.629 3415.644
## [18,] 3348.903 3349.134 3351.170 3347.130 3346.053 3350.302 3359.213 3357.603
## [19,] 5980.798 5986.757 5989.432 5993.437 5991.424 5992.171 5988.849 5990.996
## [20,] 4661.111 4657.531 4654.670 4658.836 4654.202 4658.552 4651.327 4652.688
## [21,] 5538.760 5545.595 5548.132 5547.101 5539.278 5538.960 5533.494 5538.427
## [22,] 4721.932 4718.869 4718.121 4723.065 4716.545 4723.864 4707.842 4711.154
## [23,] 5758.530 5765.647 5769.638 5774.132 5772.290 5774.607 5770.817 5772.964
## [24,] 4552.373 4549.268 4548.617 4543.529 4538.908 4541.304 4543.194 4537.469
## [25,] 4489.542 4484.203 4484.866 4491.097 4485.582 4491.587 4489.968 4492.514
## [26,] 4712.759 4708.998 4705.946 4702.900 4699.430 4700.670 4701.725 4695.615
## [27,] 4778.955 4774.905 4776.781 4771.372 4768.250 4769.303 4769.608 4765.001
## [28,] 5384.691 5385.235 5385.141 5389.125 5387.147 5392.529 5388.101 5383.717
## [29,] 4775.059 4770.056 4768.995 4777.330 4775.592 4778.914 4773.873 4772.376
## [30,] 4935.928 4936.707 4930.309 4923.153 4918.567 4917.930 4915.430 4908.312
## [31,] 5536.766 5538.766 5545.554 5546.521 5542.522 5543.727 5542.651 5539.523
## [32,] 3938.890 3943.103 3936.925 3938.166 3933.473 3935.270 3933.969 3937.232
## [33,] 3468.759 3478.235 3479.272 3480.654 3477.790 3480.315 3477.178 3477.478
## [34,] 3738.808 3741.191 3741.624 3739.216 3733.682 3735.613 3729.949 3730.941
## [35,] 3531.088 3538.212 3530.074 3525.763 3518.741 3519.277 3517.307 3521.897
## 6500 6600 6700 6800 6900 7000 7100 7200
## [1,] 4173.647 4171.222 4171.796 4171.069 4171.320 4172.487 4175.987 4176.613
## [2,] 3756.881 3756.546 3764.661 3764.128 3768.124 3768.821 3771.436 3770.867
## [3,] 4244.469 4246.291 4247.381 4250.864 4253.611 4251.799 4257.433 4258.665
## [4,] 3841.229 3839.048 3838.735 3837.387 3840.696 3845.287 3845.784 3843.271
## [5,] 3949.547 3953.897 3952.362 3950.732 3949.639 3954.772 3954.757 3955.180
## [6,] 3726.865 3727.381 3726.497 3724.789 3724.868 3723.395 3724.923 3727.906
## [7,] 3680.604 3681.558 3674.612 3673.811 3669.224 3665.989 3668.556 3672.171
## [8,] 4605.346 4607.532 4611.095 4608.382 4610.402 4609.399 4611.814 4617.738
## [9,] 3905.950 3898.771 3900.558 3897.308 3902.170 3900.778 3899.488 3896.337
## [10,] 3203.815 3202.249 3202.143 3210.724 3205.715 3202.633 3203.926 3207.695
## [11,] 3939.082 3939.758 3937.374 3934.420 3929.131 3926.747 3926.618 3930.242
## [12,] 3336.951 3334.091 3326.129 3322.219 3317.470 3309.454 3305.596 3307.130
## [13,] 3674.448 3673.629 3675.075 3673.286 3678.373 3680.099 3677.518 3678.018
## [14,] 4462.321 4468.106 4471.664 4471.439 4471.899 4469.223 4467.739 4469.683
## [15,] 3581.847 3578.487 3584.580 3586.719 3590.021 3584.679 3582.405 3581.300
## [16,] 3746.920 3746.323 3747.401 3743.816 3736.925 3731.934 3732.516 3738.877
## [17,] 3414.965 3418.435 3425.265 3420.774 3423.180 3424.845 3427.000 3432.450
## [18,] 3360.382 3353.325 3358.422 3359.280 3362.534 3364.082 3364.983 3367.475
## [19,] 5992.169 5987.535 5983.607 5984.446 5987.469 5991.817 5987.187 5981.606
## [20,] 4644.468 4643.304 4641.188 4633.641 4637.823 4635.158 4638.328 4640.222
## [21,] 5535.493 5531.462 5529.761 5525.329 5531.103 5529.788 5523.788 5524.558
## [22,] 4700.711 4699.953 4692.258 4698.197 4697.184 4694.168 4691.623 4691.097
## [23,] 5775.687 5772.891 5766.800 5765.069 5766.398 5774.574 5771.709 5770.799
## [24,] 4539.867 4538.811 4543.481 4540.181 4544.800 4548.805 4544.769 4544.653
## [25,] 4489.148 4488.610 4484.250 4476.981 4480.126 4480.259 4477.959 4480.429
## [26,] 4696.681 4693.786 4700.802 4697.598 4701.080 4699.545 4697.458 4694.929
## [27,] 4771.306 4772.259 4774.883 4769.289 4777.624 4785.122 4776.751 4778.596
## [28,] 5386.757 5388.385 5389.833 5396.099 5397.450 5396.878 5395.885 5388.910
## [29,] 4771.186 4773.234 4772.534 4774.376 4773.648 4768.852 4769.665 4771.654
## [30,] 4908.682 4902.957 4900.142 4901.648 4899.486 4890.905 4890.737 4889.602
## [31,] 5544.914 5542.460 5541.113 5535.935 5535.930 5544.720 5539.803 5539.993
## [32,] 3931.210 3929.730 3927.218 3929.806 3930.679 3927.879 3930.081 3923.146
## [33,] 3474.173 3470.470 3474.766 3478.224 3481.508 3477.945 3485.532 3482.975
## [34,] 3730.751 3736.004 3740.367 3738.737 3734.319 3731.204 3739.219 3744.125
## [35,] 3520.596 3523.795 3520.044 3526.548 3524.744 3519.599 3521.747 3527.445
## 7300 7400 7500 7600 7700 7800 7900 8000
## [1,] 4170.393 4172.204 4175.163 4168.802 4171.979 4174.173 4168.066 4161.474
## [2,] 3775.037 3774.027 3777.149 3776.107 3772.247 3772.652 3771.743 3771.792
## [3,] 4255.327 4256.196 4254.977 4254.865 4257.091 4261.421 4253.080 4247.544
## [4,] 3849.555 3856.124 3863.337 3862.460 3865.330 3860.370 3856.675 3856.260
## [5,] 3958.143 3960.686 3967.758 3968.164 3973.935 3970.060 3968.468 3967.348
## [6,] 3730.196 3730.365 3729.980 3730.540 3732.925 3737.947 3739.985 3746.420
## [7,] 3673.404 3676.312 3674.783 3672.302 3675.431 3676.260 3676.456 3680.969
## [8,] 4615.624 4620.236 4624.366 4619.587 4623.840 4622.529 4622.783 4622.763
## [9,] 3896.658 3899.479 3903.946 3895.637 3897.913 3890.052 3890.043 3886.634
## [10,] 3207.356 3208.165 3208.895 3207.133 3207.617 3206.404 3210.526 3207.283
## [11,] 3927.827 3934.654 3936.879 3932.722 3930.691 3931.653 3934.322 3931.810
## [12,] 3305.580 3308.080 3296.396 3293.515 3289.001 3284.473 3289.685 3283.610
## [13,] 3679.557 3680.332 3682.106 3678.995 3679.085 3676.607 3677.357 3674.290
## [14,] 4471.571 4470.160 4475.368 4477.637 4482.701 4481.843 4482.929 4488.446
## [15,] 3583.152 3583.913 3581.344 3584.494 3581.080 3575.977 3573.963 3570.277
## [16,] 3736.824 3736.852 3742.033 3740.221 3739.691 3736.590 3740.159 3735.662
## [17,] 3430.489 3431.993 3433.811 3432.856 3430.780 3433.098 3436.276 3435.149
## [18,] 3372.092 3374.379 3373.969 3372.938 3373.448 3373.904 3374.797 3370.636
## [19,] 5982.438 5985.882 5984.907 5983.808 5977.382 5975.436 5978.080 5981.632
## [20,] 4635.826 4632.499 4633.526 4630.701 4635.133 4637.647 4627.865 4627.494
## [21,] 5521.323 5522.579 5524.325 5521.448 5515.653 5513.806 5507.075 5509.688
## [22,] 4690.717 4689.280 4685.777 4691.782 4696.635 4701.914 4691.121 4694.538
## [23,] 5769.678 5770.399 5773.256 5767.711 5765.157 5764.026 5765.113 5767.981
## [24,] 4538.713 4539.801 4543.330 4540.809 4544.609 4539.469 4541.255 4534.833
## [25,] 4476.464 4469.593 4473.026 4477.075 4488.702 4489.276 4486.135 4484.014
## [26,] 4690.352 4688.014 4690.507 4688.155 4686.190 4683.880 4681.158 4676.952
## [27,] 4774.921 4772.668 4777.924 4774.004 4777.704 4774.626 4775.262 4771.220
## [28,] 5389.793 5385.007 5384.062 5384.851 5384.051 5390.183 5393.152 5390.675
## [29,] 4770.520 4768.347 4767.253 4768.544 4770.894 4777.961 4770.737 4771.419
## [30,] 4890.441 4887.720 4884.759 4885.704 4875.914 4881.913 4880.209 4875.568
## [31,] 5534.778 5539.695 5544.582 5538.413 5534.666 5533.076 5533.575 5533.767
## [32,] 3927.812 3927.274 3925.214 3924.038 3925.432 3926.836 3928.614 3925.758
## [33,] 3478.715 3476.394 3477.560 3478.736 3477.224 3475.551 3471.037 3473.294
## [34,] 3741.326 3744.302 3742.307 3745.915 3742.485 3745.557 3746.817 3749.093
## [35,] 3528.047 3529.064 3525.463 3522.443 3522.363 3521.262 3523.077 3525.570
## 8100 8200 8300 8400 8500 8600 8700 8800
## [1,] 4167.852 4170.545 4178.859 4176.411 4176.360 4175.752 4167.799 4167.868
## [2,] 3775.695 3774.753 3779.352 3781.721 3777.367 3778.827 3778.975 3783.555
## [3,] 4254.835 4263.048 4266.723 4266.064 4266.383 4270.614 4264.011 4267.327
## [4,] 3860.736 3853.970 3859.687 3863.349 3860.903 3859.220 3856.657 3862.491
## [5,] 3968.019 3959.671 3963.108 3966.319 3967.662 3966.648 3966.289 3968.057
## [6,] 3750.487 3742.422 3746.768 3742.065 3738.535 3740.014 3737.233 3739.524
## [7,] 3685.331 3679.914 3684.006 3682.185 3680.466 3684.173 3685.575 3684.151
## [8,] 4627.015 4627.592 4627.473 4632.269 4628.943 4633.424 4630.735 4635.008
## [9,] 3890.237 3888.095 3888.881 3891.558 3887.085 3885.035 3882.590 3884.683
## [10,] 3214.609 3211.566 3213.858 3214.160 3208.312 3209.539 3207.740 3210.179
## [11,] 3934.498 3933.221 3935.627 3937.139 3934.409 3936.752 3929.571 3931.955
## [12,] 3283.732 3280.535 3279.535 3273.070 3262.990 3259.259 3257.194 3254.654
## [13,] 3680.244 3678.402 3677.579 3681.852 3680.305 3678.627 3677.407 3677.248
## [14,] 4487.816 4484.488 4480.506 4478.282 4478.922 4480.981 4483.178 4488.763
## [15,] 3569.349 3570.627 3569.337 3567.044 3565.593 3563.987 3564.400 3561.301
## [16,] 3730.693 3731.427 3730.963 3729.867 3725.957 3726.293 3724.571 3721.929
## [17,] 3439.719 3440.485 3443.887 3443.386 3442.533 3433.465 3435.632 3432.979
## [18,] 3373.423 3374.120 3374.979 3380.576 3378.399 3377.790 3377.513 3373.161
## [19,] 5976.687 5984.224 5983.744 5982.865 5984.478 5972.930 5975.220 5976.111
## [20,] 4630.192 4637.335 4636.611 4639.002 4640.751 4637.499 4637.632 4635.490
## [21,] 5506.132 5507.324 5500.681 5499.375 5503.863 5494.942 5493.417 5491.607
## [22,] 4694.080 4690.957 4685.903 4682.775 4685.107 4677.615 4668.832 4666.401
## [23,] 5763.301 5765.149 5765.218 5760.168 5766.088 5755.409 5761.277 5764.775
## [24,] 4533.510 4528.837 4528.578 4536.233 4531.662 4531.676 4528.045 4532.406
## [25,] 4487.088 4489.724 4488.340 4494.143 4491.206 4495.009 4485.623 4487.053
## [26,] 4677.032 4674.987 4672.532 4677.342 4675.084 4671.499 4670.595 4676.023
## [27,] 4768.545 4767.808 4767.463 4769.941 4761.501 4758.121 4754.824 4755.731
## [28,] 5386.724 5381.847 5385.227 5381.610 5392.051 5389.698 5393.919 5399.586
## [29,] 4773.768 4769.564 4767.532 4761.738 4770.427 4766.602 4763.690 4762.775
## [30,] 4871.242 4870.711 4868.782 4862.963 4871.290 4868.085 4871.281 4871.955
## [31,] 5530.968 5536.816 5537.109 5533.525 5536.936 5531.331 5534.446 5528.812
## [32,] 3922.302 3926.886 3919.861 3919.761 3916.290 3915.364 3911.063 3913.624
## [33,] 3477.949 3477.761 3481.982 3484.913 3481.612 3481.001 3478.494 3481.006
## [34,] 3753.024 3753.748 3747.590 3747.765 3747.916 3751.898 3748.724 3750.077
## [35,] 3519.094 3523.308 3515.917 3517.194 3520.832 3517.656 3523.560 3526.806
## 8900 9000 9100 9200 9300 9400 9500 9600
## [1,] 4169.739 4172.715 4169.140 4173.846 4180.082 4181.027 4179.265 4180.080
## [2,] 3783.693 3790.552 3793.606 3800.312 3802.263 3806.770 3808.989 3806.171
## [3,] 4268.064 4273.429 4269.932 4276.330 4280.850 4277.881 4279.836 4274.760
## [4,] 3863.596 3863.355 3869.236 3871.724 3875.626 3880.022 3877.810 3875.378
## [5,] 3967.501 3974.144 3981.073 3983.068 3980.164 3978.663 3980.592 3976.249
## [6,] 3739.330 3742.335 3742.736 3746.263 3741.520 3744.369 3740.394 3737.395
## [7,] 3683.291 3688.014 3689.809 3691.792 3685.259 3685.533 3683.158 3678.974
## [8,] 4640.669 4643.361 4640.980 4642.318 4642.041 4643.435 4635.095 4637.184
## [9,] 3886.342 3885.671 3882.216 3878.642 3882.577 3885.541 3883.395 3884.841
## [10,] 3211.826 3211.662 3210.506 3215.881 3211.585 3205.863 3206.364 3203.702
## [11,] 3936.267 3939.051 3939.385 3943.654 3944.487 3947.472 3942.901 3941.168
## [12,] 3250.957 3251.156 3242.489 3235.856 3229.693 3223.610 3218.417 3209.041
## [13,] 3676.273 3678.887 3686.989 3684.887 3688.412 3689.251 3694.301 3696.327
## [14,] 4484.884 4485.770 4480.687 4485.070 4483.267 4487.369 4482.675 4484.538
## [15,] 3558.513 3551.799 3553.624 3554.926 3555.201 3553.767 3548.149 3548.903
## [16,] 3720.523 3725.437 3717.398 3724.198 3721.177 3726.709 3719.951 3715.087
## [17,] 3427.144 3434.235 3436.097 3434.002 3436.242 3438.103 3435.976 3434.735
## [18,] 3371.160 3370.969 3381.167 3382.151 3383.962 3384.377 3390.261 3392.736
## [19,] 5976.651 5975.749 5979.165 5978.012 5976.024 5970.565 5969.432 5974.348
## [20,] 4638.760 4637.320 4634.867 4640.439 4635.896 4636.610 4629.255 4633.241
## [21,] 5491.149 5489.636 5492.413 5487.153 5486.691 5484.041 5481.993 5486.530
## [22,] 4663.811 4661.104 4660.911 4662.752 4663.636 4662.587 4656.272 4656.656
## [23,] 5761.476 5761.167 5760.340 5756.338 5754.902 5752.898 5751.271 5757.629
## [24,] 4540.689 4538.275 4535.915 4536.680 4533.012 4537.586 4540.240 4539.802
## [25,] 4488.476 4488.665 4488.854 4495.274 4493.921 4496.047 4492.759 4498.523
## [26,] 4681.328 4680.071 4674.952 4676.735 4672.721 4677.257 4678.417 4677.139
## [27,] 4759.581 4757.355 4755.946 4757.791 4755.139 4758.031 4757.797 4756.379
## [28,] 5395.625 5393.587 5399.153 5393.749 5390.587 5388.015 5391.160 5391.354
## [29,] 4762.411 4758.621 4759.932 4756.862 4759.521 4764.705 4762.524 4762.626
## [30,] 4870.469 4866.944 4870.391 4864.094 4862.808 4865.852 4865.595 4864.536
## [31,] 5531.216 5530.417 5526.915 5520.394 5520.422 5518.889 5516.669 5522.830
## [32,] 3911.821 3913.631 3914.916 3910.520 3913.526 3907.945 3913.255 3906.642
## [33,] 3482.340 3484.523 3482.587 3484.772 3486.479 3483.299 3484.990 3481.395
## [34,] 3751.655 3752.518 3751.497 3751.489 3748.922 3746.712 3741.841 3738.650
## [35,] 3526.782 3526.942 3530.186 3525.398 3529.046 3526.541 3528.419 3523.949
## 9700 9800 9900 10000
## [1,] 4177.679 4183.725 4184.294 4187.233
## [2,] 3811.662 3813.099 3816.289 3822.271
## [3,] 4275.666 4282.963 4286.488 4291.703
## [4,] 3873.352 3875.642 3881.512 3887.323
## [5,] 3977.382 3981.813 3990.024 3990.733
## [6,] 3740.424 3736.737 3741.503 3742.279
## [7,] 3681.491 3680.004 3686.445 3686.184
## [8,] 4635.430 4635.835 4636.045 4635.301
## [9,] 3880.634 3882.422 3881.772 3883.561
## [10,] 3205.912 3205.553 3207.120 3213.950
## [11,] 3938.171 3939.069 3938.522 3940.026
## [12,] 3209.468 3210.297 3207.412 3206.333
## [13,] 3691.418 3694.907 3697.338 3697.155
## [14,] 4484.411 4482.481 4483.539 4480.801
## [15,] 3541.562 3543.050 3540.916 3544.131
## [16,] 3713.848 3712.487 3710.696 3710.865
## [17,] 3430.531 3436.182 3436.208 3435.869
## [18,] 3390.150 3391.116 3390.157 3391.291
## [19,] 5977.082 5975.222 5975.462 5967.932
## [20,] 4631.280 4632.754 4633.375 4633.431
## [21,] 5484.119 5484.433 5486.256 5480.900
## [22,] 4654.621 4651.264 4655.438 4647.301
## [23,] 5756.188 5753.292 5750.306 5749.071
## [24,] 4537.278 4535.919 4528.829 4524.549
## [25,] 4497.056 4495.678 4490.769 4488.612
## [26,] 4673.004 4672.744 4670.951 4668.866
## [27,] 4751.855 4752.171 4748.194 4743.255
## [28,] 5393.745 5398.663 5399.500 5399.393
## [29,] 4760.904 4758.133 4760.721 4760.471
## [30,] 4863.445 4865.679 4866.641 4870.319
## [31,] 5521.156 5516.610 5517.547 5515.287
## [32,] 3906.320 3910.785 3914.296 3919.073
## [33,] 3477.471 3480.542 3479.160 3478.220
## [34,] 3739.633 3740.111 3734.075 3731.693
## [35,] 3522.349 3522.481 3521.018 3524.629
dim(predmat)
## [1] 35 100
err <- apply((predmat-penguins_test$body_mass_g)^2, 2, mean)
plot(ntree, err, type = 'l', col = 2, lwd = 2, xlab = "n.trees", ylab = "Test MSE")
library(randomForest)
## randomForest 4.7-1.1
## Type rfNews() to see new features/changes/bug fixes.
rf <- randomForest(body_mass_g~., data=penguins_train, importance = TRUE, ntree = 10000)
a) Based on the percent of variation explained by the model, do you believe that the random forest fits your data well?
With a variation % of 83.11, the random forest fits the data well.
b) What is the out-of-bag error for the random forest?
The Out-of-bag error for the random forest is 104879.5.
c) What are the two most important covariates in your random forest model?
rf$importance
## %IncMSE IncNodePurity
## species 361546.09 47512356
## island 113466.40 16225100
## bill_length_mm 103671.04 23029901
## bill_depth_mm 107194.06 33168637
## flipper_length_mm 355530.43 59850191
## year 4879.01 2407226
The 2 most important covariats in this random forest models are species and flipper_length_mm.
d) Use the testing set to calculate the MSE for your random forest model. Based on your results, is the random forest more accurate than the boosting model? Or is your boosting model more accurate than your random forest?
penguins_rf_pred_test <- predict(rf, penguins_test)
mean((penguins_test$body_mass_g - penguins_rf_pred_test)^2)
## [1] 120868.7
Based on the results, the boosting model is more accurate than the random forest.
e) Create a graph comparing the out-of-bag error to the number of trees used in the random forest model. Based on this graph, does it appear that a large number of trees are needed to develop a fairly accurate random forest model?
plot(rf$mse, type = 'l', col = 2, lwd = 2, xlab = "Number of Trees", ylab = "Out-Of-Bag Error")
Based on the graph, there is no significant evidence that a larger number of trees are needed to develop a fairly accurate random forest model.