asadoughi / stat-learning

Notes and exercise attempts for "An Introduction to Statistical Learning"
http://asadoughi.github.io/stat-learning
2.12k stars 1.62k forks source link

Ch7 9(d) bs(4) has *ONE* knot #95

Open SONGDONGYUAN1994 opened 6 years ago

SONGDONGYUAN1994 commented 6 years ago
  1. First, bs(4) should have only ONE knot;
  2. Second, it seems like when adding both df and knot in bs(), the result is not just ignoring knot.
leowang396 commented 4 years ago

agreed.

also, plot of cubic spline fit with 4 degrees of freedom behaves quite well at extreme dis values, not showing the wiggly tails in seen in the proposed answer.