Hello,
The output object of the R loess
function has an estimator for the number of parameters (enp) of a given loess fit. It would be nice to have that here in Loess as well. To be able to estimate and characterise the error variance of the non-parametric loess fit, in terms of degrees of freedom (n-enp).
According to https://en.wikipedia.org/wiki/Degrees_of_freedom_(statistics)#In_non-standard_regression, df ~= n - 1.25 tr(H) + 0.5
. So, having access to the Hat matrix, the degrees of freedom can be estimated pretty easily.
I'm not sure though, if the number of data points minus the estimated number of parameters above, matches the degrees of freedom. That is, if that formula from Wikipedia is correct for df
estimation in loess.
To make matters worse, there's another parameter called df
, which confused me. But this is a parameter of a given loess prediction, not fit (see help(loess.predict)
) (?)
So, in the end, I don't know how to compute the effective degrees of freedom of a loess fit. :-/