25/10/2020

Fitting a functions using linear models

  • Consider a model \(Y_i = f(X_i) + \epsilon\).

  • The shiny app demonstrates fitting such a model using linear models (called scatterplot smoothing)

  • The model adds extra terms as below, \[ Y_i = \beta_0 + \beta_1 X_i + \sum_{k=1}^d (x_i - \xi_k)_+ \gamma_k + \epsilon_{i} \] where \((a)_+ = a\) if \(a > 0\) and \(0\) otherwise and \(\xi_1 \leq ... \leq \xi_d\) are known knot points.

  • Application allows the user to add & adjust 2 knot points and demonstrates how the \(R^2\) improves & \(\sigma\) is reduced.

The linear model approximation !!

  • Almost always an approximation, and sometimes a poor one.

- The app first shows the drawback when launched.

Slide with Plot