https://github.com/maxkapur/clampedregression.jl
Linear regression with clamped values via integer programming
https://github.com/maxkapur/clampedregression.jl
Last synced: 2 months ago
JSON representation
Linear regression with clamped values via integer programming
- Host: GitHub
- URL: https://github.com/maxkapur/clampedregression.jl
- Owner: maxkapur
- License: mit
- Created: 2023-12-03T14:24:47.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-09T16:00:02.000Z (over 1 year ago)
- Last Synced: 2025-01-22T12:31:49.614Z (4 months ago)
- Language: Julia
- Size: 43.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ClampedRegression.jl

As the plot above illustrates, normal linear regression is often a poor fit for real-world data that has a known lower and upper bound. In such cases, a more effective approach is to use logistic regression, which fits a sigmoid form to the data that approaches (without ever reaching) the bounds. Logistic regression is computationally efficient.
This repository demonstrates a different and worse approach. Instead of fitting a smooth sigmoid, we fit a linear function that “clamps” to the (known) lower and upper bound values. This can be modeled with integer quadratic programming and indicator variables. The slight advantage over logistic regression is that we get zero prediction error on the “arms” of the plot, and we guarantee that our predicted values actually saturate the available range. The major downside is that this functional form is much more costly to estimate, because IP is hard.
You probably don’t want to use this. **You probably want to use logistic regression.**