title: Find confidence interval in bivariate kernel estimation with Matlab
body: <p>I'm executing this piece of code in order to estimate the probability density function of a bivariate set of random points:</p>
  
  <pre><code>x = [0+.5*rand(20,1) 5+2.5*rand(20,1);
          .75+.25*rand(10,1) 8.75+1.25*rand(10,1)];
  
  figure
  ksdensity(x);
  </code></pre>
  
  <p>and I wonder how to use the informations coming from the Matlab function <code>ksdensity</code> to evaluate the confidence interval I need.</p>
  
  <p>My goal is to find outliers points in the set, namely that points that fall over the confidence interval.</p>
  
  <p><a href="https://i.stack.imgur.com/EJANC.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EJANC.jpg" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/PSo4u.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PSo4u.jpg" alt="enter image description here"></a></p>