The change of slope model/broken-stick regression is given by with , .[1]
For , the slope of the regression line is , while for , is . The parameters here are .
If were known, then (1.1) is a linear: here .
2 Parameter Estimation
2.1 MLE
We also use MLE: After numerically solving this, the model becomes linear as mentioned just now, so Then
2.2 Uncertainty Quantification
Now switch to Bayes. Suppose prior: for a large . For , it is also uniform and the range is . However, can't be or : when , is linear. Same for . Therefore
Then Given , the model is linear. By Homework 1 Problem 4, Finally,
2.3 Posterior Sampling for Uncertainty Quantification
Drawing posterior samples from unknown parameters is a useful way to visualize the uncertainty.
Algorithm (Posterior Sampling)
Obtain samples by sampling with replacement from with probability weights given by here.
For each :
Fix .
Calculate by implementing linear regression with fixed .
Generate , then take .
Take to be a generated random vector.
So now we have for , then we can fit values
If we want to obtain posterior samples for for future , then based on the algorithm, in step 2, add 2.5: generate .
3 More Change of Slope
If we want to introduce one more break point: with , we can also write it as Then we can also have posterior For more break points, we can consider