lets write the following piecewise regression model $$y= \alpha_0 + \alpha_1 x +\epsilon ;\ \ x\le x_0 $$
$$ y=\beta_0 +\beta_1 x + \epsilon \ \ x\gt x_0$$
according to the variable $x_0$ is known, this regression model is a linear model.. then, how to write this above model as a liear model $Y= X\beta +\epsilon $ where X is matrix and $\beta$ is unkown parameter vector.
thank you for helping
$$ y = \alpha_0 + \alpha_1 x + (\beta_0 - \alpha_0)1_{x > x_0} + (\beta_1 - \alpha_1)x1_{x > x_0} + \epsilon$$
Let $\gamma_0 := \beta_0 - \alpha_0$ and $\gamma_1 := \beta_1 - \alpha_1$.
Now define $X := \begin{bmatrix}1 && x && 1_{x > x_0} && x1_{x > x_0}\end{bmatrix}$ and $\beta := \begin{bmatrix}\alpha_0 && \alpha_1 && \gamma_0 && \gamma_1\end{bmatrix}^{\top}$. Then, the first equation can be written as $$y = X\beta + \epsilon$$