In smooth.spline procedure one can use df or spar parameter to control smoothing level. Usually they are not set manually but recently I was asked a question which one of them is a better measure of regularization level. Hastie et al. (2009) discuss the advantages of df but I thought of a simple graphical illustraition of this fact.
I the following criterion to judge that some quantity measures roughness penalty well: Increasing training sample size should should influence the value of optimal roughness penalty level in a monotonic way.
I compared performance of df or spar parametrization using a sample function (defined in gen.data function) for different sizes of training sample size. Here is the code for df parametrization:
It produces the following result:
The plot shows the desired property. Similar plot can be obtained for spar parameter by simple modification of the code:
It is easy to notice that optimal values of spar do not change in a monotonic way as number of observation increases.
This comparison shows that df is a better measure of regularization level in comparison to spar.
Additionally one can notice that curves for different sizes of training sample intersect for spar parametrization, which is unexpected. It might be only due to the randomness of data generation process, but I have run the simulation several times and the curves always intersected. Unfortunately I do not have the proof what should happen when valid data set size and reps parameter both tend to infinity.