title: Generate a exponential distribution for a set of data using boost c++
body: <p>How to generate a exponential distribution for a set of data using boost c++ .</p>
  
  <p>I have a vector containing float variables named <strong>vararr</strong> and using Boost c++ and I want to fit it Exponential distribution and getting respective rate parameter(lambda) for the fit . 
  The equivalance code in Matlab is : </p>
  
  <pre><code>PD = fitdist(vararr,'exponential'); 
  vararr = sort(vararr); 
  fxx = pdf(PD,vararr);
  </code></pre>
  
  <p>I need to implement it in C++</p>