Question: 2. Analyze the motor cycle data (use library(MASS), then load data(mcycle) x=times, y=accel). Use smoothing splines to fit the data. Try different df's in [5,

 2. Analyze the "motor cycle data" (use "library(MASS)", then load "data(mcycle)"

2. Analyze the "motor cycle data" (use "library(MASS)", then load "data(mcycle)" x=times, y=accel). Use smoothing splines to fit the data. Try different df's in [5, 20]. Find the optimal df in [5, 10] according the cross-validation criterion (in the function "smooth.spline", specify "cv=T"). What is the A and cross-validation error of the best fit? Return the following three plots: (a) The observation points and the optimal smoothing spline fit. (b) The observation points and the three smoothing splines with df-5, 10, 15 (three different colored curves). Then you should also add a "legend" to denote these lines. (c) Plot the cross validation errors against different df's from 5 to 20 (show both points and lines). The step of df's is 0.5. (Hint: from this plot you can find the optimal df.) 3. Choose one of the following: . Program your own version of natural cubic spline fitting (with the interpolation requirement). Test your cubic spline fitting the region of [0, 1] for the test function sinh(x) = e. You can arrange the knots equally spaced between in the region [0, 1]. Comparing the choice of different knots, K = 5, 10, 15

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!