I tried to fit the following plot(red dot) with the Zipf distribution PDF in Python, F~x^(-a). I simply chose a=0.56
and plotted y = x^(-0.56)
, and I got the curve shown below.
The curve is obviously wrong. I don't know how to do the curve fitting.
Not sure what you are exactly looking for, but if you want to fit a model (function) to data, use
scipy.optimize.curve_fit
:If you don't trust the normalization, add a second parameter
b
and fit that as well.