Skip to content

Finding the knots in a smoothing spline using nknots

2 messages · Mike Nielsen, David Winsemius

#
On Feb 27, 2013, at 6:39 AM, Mike Nielsen wrote:

            
It appears they are in the range of [0-1] and the ss$fit$min and ss$fit$range provide the scaling data (.... for the x-values rather than the y-values):
[1] 0.00000000 0.04095904 0.08291708 0.12487512 0.16583417 0.20779221 0.24975025 0.29070929
 [9] 0.33266733 0.37462537 0.41658342 0.45754246 0.49950050 0.54145854 0.58241758 0.62437562
[17] 0.66633367 0.70829171 0.74925075 0.79120879 0.83316683 0.87412587 0.91608392 0.95804196
[25] 1.00000000

I would think that in your case with x0 being 0 you could just use ss$fit$range*unique(ss$fit$knot) as your knot positions. In the more geneneral case you would need to add ss$fit$min. I tried confirming this hunch by looking "statiscal Models in S", inMASSe4, and at the R code but the R code calls a FORTRAN routine, so you would need to pull the source to confirm.