How is numparam calculated for smoothing splines?
1 view (last 30 days)
Show older comments
I am using the function: [fitobject,gof,output]=fit(x,y,'smoothingspline','smoothingparam',s); where 's' is the chosen level of smoothing.
I understand that output.numparam gives "Number of unknown parameters (coefficients) to fit", but I am not sure how MATLAB calculates this number for the (cubic) smoothing spline. It changes for each level of 's' - from 2 with maximum smoothing (makes sense since it is a linear function), to >40, and with the exception of maximum smoothing it usually includes decimals, which I'm finding hard to interpret. I would be really grateful if anyone could tell me what this number indicates and/or how it is calculated. Thank you.
0 Comments
Answers (1)
Archoran Encor
on 23 Aug 2021
It's the same question I had to answer for a research project of mine today. It is basically the trace of the smoothing matrix - being a value between 2 and your number of input points. That's some hell of a formula using the smoothing value p and the sum of all spline leverages. But I think Matlab is only being stuck with their own definitions there...
But basically you can refer to this value as maximum degrees of freedom of your interpolation.
0 Comments
See Also
Categories
Find more on Spline Postprocessing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!