To overcome the weakness of local polynomial regression, natural cubic spline appears. This model adds linear constraint on the border line.
To add this constraint, we need to think about this equation.
f(X)=β1​+β2​X+β3​(d1​(X)−dK−1​(X))+⋯+βK​(dK​(X)−dK−1​(X)) dk​(X)=ξK​−ξk​(X−ξk​)+3​−(X−ξK​)+3​​ Proof: https://statkwon.github.io/ml/natural-spline/