1
$\begingroup$

I haven't been doing math in years and I'm facing the following problem. I'm trying to implement in Java a linear regression under a set of inequality constraints. Sorry in advance for all the approximations while trying to formulate this problem...

More precisely, I have a linear function $f_\Theta:R^n->R$ defined as such: $f_\Theta(X) = \theta_0 + \theta_1x_1+ \theta_0x_2+... \theta_nx_n$, with $\Theta$ a (n+1) vector.

My aim is to $\min_\Theta \sum_{i}||f_\Theta(X_i)-Y_i||^2$ under the constraint that $f_\Theta(X_i)-Y_i < 0$ for a maximum of $i$ (I wish I could avoid to take into account "obvious" outliers in my observations)

So, bottom line, I'm looking for the linear regression that will act as the "best fit" providing a lower bound for most/all the observations.

How can I do that ? I've been looking for a Java Library that would implement such a thing. I known the Apache Common Math package and I also found this Flanagan library, but it does not seem to address this.

Any help greatly appreciated. Thanks

$\endgroup$
5
  • $\begingroup$ Programming is offtopic here. I don't know if Computational Science wants to have such questions; if not, Stack Overflow is the place. $\endgroup$
    – Raphael
    Commented Oct 11, 2017 at 10:27
  • $\begingroup$ FWIW, Java is most certainly not the correct tool for numerical algorithms. $\endgroup$
    – Raphael
    Commented Oct 11, 2017 at 10:27
  • $\begingroup$ Hi Raphael, what would you advice me to do ? Because there is a mathematical part I would like to understand as well as an implementation part too. Posting this on stack overflow, I'm afraid I will have only people trying to focus on the programming part. Thanks $\endgroup$ Commented Oct 11, 2017 at 10:37
  • $\begingroup$ Sounds like Computational Science might be your place! I can migrate your question there. Do you want to ask in their chat whether your question would be welcome first? $\endgroup$
    – Raphael
    Commented Oct 11, 2017 at 10:39
  • $\begingroup$ Looks like you are right. Yes, could you please move my question there if you can ? Thanks a lot ! $\endgroup$ Commented Oct 11, 2017 at 10:42

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.