Answers.Body: <p>I don't know of a pre-canned algorithm but I would just sweep on the angle from zero to ninety degrees with a triangular region and count the points.  For each step in the sweep, record the angle and the count.  When the sweep is done you will have an array of angles with bin counts and then you can convert to percentage of total count.  You will have to figure out a resolution of the triangle's angle so that it is fine enough to capture less than 5% of the points.</p>
  
  <p><a href="https://i.sstatic.net/ctywK.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/ctywK.png" alt="enter image description here"></a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-27T12:49:24.580Z
Answers.Text: Thanks for your idea ! I forgot to mention it but I used a 2-dimensional example only because it was easier to explain. I would like to do this in higher dimensions (more predictors), which makes it harder...
Answers.UserDisplayName: olafgrossebaf
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-27T16:15:09.077Z
Answers.Text: @user15281 I'd upvote this answer since you didn't specify n dimensions in the question, and it's useful to see 2D approaches in building toward n dimensional approaches.
Answers.UserDisplayName: DukeZhou
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-27T12:11:29.367Z
Answers.LastActivityDate: 2018-04-27T12:11:29.367Z
Answers.UserDisplayName: Brian O'Donnell
Body: <p>I have a data set that looks like this:<br/></p>
  
  <p><a href="https://i.sstatic.net/Nd0qN.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Nd0qN.png" alt="data set"></a></p>
  
  <p>I would like to estimate a relationship between x-values and the corresponding 5% extreme y-values, something that might look like that :<br/></p>
  
  <p><a href="https://i.sstatic.net/TfBTp.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/TfBTp.png" alt="regression on extreme values"></a></p>
  
  <p>Do you have an idea of an algorithm that might help me for this ? I thought about labelling the extreme values for later finding a separating hyperplane, but I have no clue on how to label these "extreme values" (I cannot just take the 5% lowest and highest values as all these would end up in the same region).</p>
  
  <p>Thanks for your ideas ! </p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-27T16:16:48.513Z
Comments.Text: Welcome to AI!  You many want to consider adding an addendum to explain that the overall problem is not restricted to two dimensions. :)
Comments.UserDisplayName: DukeZhou
Tags: <machine-learning><linear-regression>
Title: Regression on extreme values
UserDisplayName: olafgrossebaf
ThreadText: # Regression on extreme values
  
  (Asked by: username_0 on 2018-04-27)
  
  I have a data set that looks like this:
  
  [![data set](https://i.sstatic.net/Nd0qN.png)](https://i.sstatic.net/Nd0qN.png)
  
  I would like to estimate a relationship between x-values and the corresponding 5% extreme y-values, something that might look like that :
  
  [![regression on extreme values](https://i.sstatic.net/TfBTp.png)](https://i.sstatic.net/TfBTp.png)
  
  Do you have an idea of an algorithm that might help me for this ? I thought about labelling the extreme values for later finding a separating hyperplane, but I have no clue on how to label these "extreme values" (I cannot just take the 5% lowest and highest values as all these would end up in the same region).
  
  Thanks for your ideas !
  
  **Tags:** machine-learning, linear-regression
  > **Comments:**
  > **username_1**: Welcome to AI!  You many want to consider adding an addendum to explain that the overall problem is not restricted to two dimensions. :)  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2018-04-27. Score: 2
  
  I don't know of a pre-canned algorithm but I would just sweep on the angle from zero to ninety degrees with a triangular region and count the points. For each step in the sweep, record the angle and the count. When the sweep is done you will have an array of angles with bin counts and then you can convert to percentage of total count. You will have to figure out a resolution of the triangle's angle so that it is fine enough to capture less than 5% of the points.
  
  [![enter image description here](https://i.sstatic.net/ctywK.png)](https://i.sstatic.net/ctywK.png)
  
  > **Comments:**
  > **username_0**: Thanks for your idea ! I forgot to mention it but I used a 2-dimensional example only because it was easier to explain. I would like to do this in higher dimensions (more predictors), which makes it harder...  
  > **username_1**: @user15281 I'd upvote this answer since you didn't specify n dimensions in the question, and it's useful to see 2D approaches in building toward n dimensional approaches.  
  
  ---
  
  