Question: 1. In this exercise, we will implement cross validation to select the tuning parameter for ridge regression and for lasso. (a) Use the 'seatpos'
1. In this exercise, we will implement cross validation to select the tuning parameter for ridge regression and for lasso. (a) Use the 'seatpos' dataset with 'hipcenter' as the response and all other variables as possible predictors. Write your own program to perform 4-fold cross validation to select the tuning parameterfor ridge regression and for lasso. (b) Provide the estimates of regression parameters using the tuning parameters selected. Recall that for 4-fold cross validation, we split the data into 4 folds and treat each fold as a test dataset while using the other folds of the data for fitting the model.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
