title: How do I fit distributions to data sets in matlab?
body: <p>I'm trying to find a fit to my data using matlab but I'm having a lot of trouble, here's what ive done so far:</p>
  
  <pre><code>A = load('homicide_crime.txt')  % A is a two column array the first column is the year and the second column is crime in that year
  norm_crime = (A(:,2)-mean(A(:,2)))/std(A(:,2)); 
  [f,x]=hist(norm_crime,20);
  plot(x,f/trapz(x,f))
  y=normpdf(x,0,1);
  hold on
  plot(x,y)
  </code></pre>
  
  <p>This is the resulting plot</p>
  
  <p><img src="https://i.stack.imgur.com/ijrzl.png" alt="">.</p>
  
  <p>So i tried afterwards using the distribution fitter which gave me this.
   <img src="https://i.stack.imgur.com/qxEbY.png" alt="">
  Neither of these things look right since the peak aren't aligned and the fit is too small.</p>
  
  <p>Here is the data set for anyone intrested
  <a href="https://pastebin.com/CyddrN1R" rel="nofollow noreferrer">https://pastebin.com/CyddrN1R</a>.</p>
  
  <p>Any help is much appreciated.</p>