Local Weighted Regression (loess), degree = 1 (linear)

The loess technique applies smoothing to the data, using equations instead of the mean value of the span. We will first apply degree 1, which fits the estimates as local lines. The distribution curve applied by loess is the Tukey tri-weight density.
The span used is 3 weeks.

The ggplot has the geom_smooth function, which applies loess regression. This function also plots the 95% confidence interval.

Local Weighted Regression (loess), degree = 2 (parabola)

We can change the loess degree parameter to two. The estimates will be local parabolas instead of lines.
The span used here is 4 weeks.