R: "family" and "degree" specification in loess fitting I can't understand the difference between the possible specifications of the family option in the loess command in R. This is what I found in the help of the loess command:

For the default family, fitting is by (weighted) least squares. For family="symmetric" a few iterations of an M-estimation procedure with Tukey's biweight are used. Be aware that as the initial value is the least-squares fit, this need not be a very resistant fit.

Is it a matter of robustness?
About the degree: can I use the same loess command with degree = 0 to obtain the k-nearest neighbors algorithm for regression? Or is it necessary to specify something else (e.g. uniform kernel, weights, ...)?
 A: Loess iteratively estimates the smoothing function. Part of the iteration involves a regression procedure to estimate the parameters of a smoothing spline as a predictive function. The option "degree" is the polynomial degree of the smoothing spline. As noted in the help file, family has to do with how the polynomial is estimated. With gaussian, you are essentially performing OLS, which hopefully is straightforward.
The M-estimator is a more general root-finding procedure. Note with M-estimation, you also get the OLS model if you use the normal score equations as the $\rho$ function and solve them analytically. Tukey's biweight function is locally linear but with tails that taper down to 0 reducing the influence of outliers.
Essentially yes, you can say this is procedure which is "robust to outliers". But that also means it excludes high influence, high leverage points even when they're the right value. On the topic of outliers, basic stat education says very little except that one "looks for outliers" in an analysis, and indeed one should. Where we've gone terribly wrong is inferring, therefore, that they should be excluded and the data omitting these values should be reported as final with minimal description of the methods. Consider however:

*

*Loess is concerned with a mean response over time. For a skewed error distribution, excluding outliers will lead to biased, inconsistent estimates of the mean

*Confidence and prediction intervals are underestimated when excluding outliers, since in replications of the study, one does not guarantee the same outlying results will necessarily be excluded

*Excluding outliers outright as an automated routine yields little in the manner of sensitivity analysis. Loess does not report which values are effectively excluded according to the biweight function.

So the parameters of the spline that are estimated provide a solution to the system of equations:
$$ \theta: \sum_{i=1}^n \psi (\hat{y} -y) = 0$$

$\psi(x)= x(1-(x^2)/(c^2))^2$   for $|x|<c$; $0$   for $|x|>c$
Where $\theta$ is the vector of parameters to the smoothing spline used to predict $y$, ($\hat{y})$.
https://mathworld.wolfram.com/TukeysBiweight.html
