Chapter 9: Bias, Variance, and Ridge Regression
Follow directional ridge shrinkage — R applications for Reasoning Through Regression.
Reasoning Through Regression: Inference, Prediction, and Regularization with R
Prof. Dr. Bahadır Yüzbaşı
Connect the declared penalty convention to coefficient MSE, tuning and assessment.
Review first: Chapters 7–8.
Data: Frozen synthetic data and R datasets::longley.
The centered-error covariance and estimated-intercept explanations have been corrected and checked; the chapter application values are unchanged.
Study sequence
- Read the chapter’s definitions and predict the output in words.
- Run the blocks in order in a fresh R session.
- Compare the numerical output with the worked example and explain any discrepancy.
- Write what the result supports, and record any help used in your learning record.
Code and execution
Download this chapter’s R script or download the complete companion folder. The folder includes the common runner and dependency notes. Extract it into your Downloads folder, then run:
cd "$HOME/Downloads/reasoning-through-regression"
Rscript --vanilla run_chapter.R 9 smoke results/ch09_attempt01
Use a new result directory for each attempt. The runner saves the executed code, console output, software versions and file checksums. For this chapter, smoke mode runs all of the small worked-example blocks.
Before a larger run, read the execution guide. The documented seeds, data roles and transformations belong to the teaching example; change them only when the exercise asks you to investigate that change.