How is numparam calculated for smoothing splines?
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Archoran Encor
2021-8-23
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spline Postprocessing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!