# Piecewise linear regression with automatic knot selection

**URL:** <https://discourse.julialang.org/t/piecewise-linear-regression-with-automatic-knot-selection/93984>\
**Category:** Statistics\
**Tags:** question, linear-regression, piecewise\
**Created:** [February 3, 2023, 11:20am UTC](https://discourse.julialang.org/t/piecewise-linear-regression-with-automatic-knot-selection/93984 "2023-02-03T11:20:36Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![PeterSimon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petersimon/32/25193_2.png) [@PeterSimon](https://discourse.julialang.org/u/PeterSimon)\
**Post date:** [February 3, 2023, 5:29pm UTC](https://discourse.julialang.org/t/piecewise-linear-regression-with-automatic-knot-selection/93984/5 "2023-02-03T17:29:29Z")

</div>

Related: If you first perform an ordinary regression which returns a function for evaluating your regression model, then the problem reduces to finding a piecewise linear approximation to that function. [This](https://discourse.julialang.org/t/hi-i-have-a-function-lets-say-f-sin-0-10-now-i-want-to-break/54826) thread contains several methods for performing adaptive piecewise linear interpolation of an arbitrary function to a user-specified error tolerance.

---

_[View the full topic](https://discourse.julialang.org/t/piecewise-linear-regression-with-automatic-knot-selection/93984)._
