title: Matlab ksdensity point range
body: <p>I am using this form of the ksdensity function in MATLAB.</p>
  
  <p><code>[f,xi] = ksdensity(x)</code></p>
  
  <p>The documentation says that "f is the vector of density values evaluated at the points in xi ...  The density is evaluated at 100 equally spaced points that cover the range of the data in x. "</p>
  
  <p>Now, my xi values cover a much larger range than the data in x. Why is this?</p>
  
  <p>For my data,</p>
  
  <pre><code>&gt;&gt; min(x)
  
  ans =
  
     -2.2588
  
  &gt;&gt; min(xi)
  
  ans =
  
     -6.8010
  &gt;&gt; max(x)
  
  ans =
  
      6.5326
  
  &gt;&gt; max(xi)
  
  ans =
  
     11.0748
  </code></pre>
  
  <p>I know I can specify an xi range myself, but why is it not equally spaced between min and max of x by default?</p>
  
  <p>It makes it hard to compare histogram estimators and kernel estimators when the bins in the histogram only cover the range of x, whereas the test points given from ksdensity exceed this range.</p>