When we have to deal with non-linear functions, one option is to fit multiple [[Univariate Linear Regression]] models that are only applied at a certain location.
![[local-linear-regression.png|center|400]]
One such location is $x_0$, where we need to define its local neighborhood $\mathcal D$. This defines which data points will be included in the fitting process of this local linear model. The $h$ parameter is the distance threshold.
$ \mathcal D= \{x:||x-x_0|| \le h\} $
Once the neighborhood is defined we fit a linear regression, where each datapoint is weighted by $w_i$, the proximity to the center point $x_0$. Often a [[Kernel Based Methods#^b82da0|Gaussian Kernel]] is being used, to assign these weights.
$ \hat \beta_{x_0}= \arg \min_\beta \sum_{x_i \in \mathcal D} w_i \big(y_i- \beta ^T(x_i-x_0)\big)^2 $
Note that our regressors are not the absolute values of $x_i$, but the differences of $x_i$ to $x_0$.