Confused about solution to the piecewise constant regression model

45 Views Asked by At

I am confused about the solution to the following solution to fitting piecewise constants:

enter image description here

Specifically, are we minimising the sum of squares, that is, finding the vector $\beta = (\beta_1,\beta_2, \beta_3)$ that minimizes: $$ \left( f(X) - \sum_{m=1}^3 \beta_m h_m(X)\right)^2 $$

Where does the integral come from? Also, as an aside, I am trying to figure out by hand the solutions to piecewise linear functions, does anyone have a good resource for where this is done explicitly? Any resources on this kind of optimisation problem would also be very appreciated.