This might be a very niche Problem. I have a modified Dataset - based on the 4th downloadlink with 105572 elements - and want to know how I can model it in the best way. I had to use Arena Software from Rockwell Software. I got the following as a result for a distribution: “816 + LOGN(198, 439)” In the picture bellow on the left side you can see the fit. From the Documentation the Output should be: “Lognormal (\mu, \sigma): LOGN (LogMean, LogStd) or LOGNORMAL (LogMean, LogStd)”. However, I would like to reconstruct it in Python.
import matplotlib.pyplot as plt
import scipy.stats as stats
import numpy as np
plt.hist(dataset, bins=bins, density=True, color='c', alpha=0.75, label="original Data")
xmin = dataset.min() #816
xmax = dataset.max() #1672
x = np.linspace(xmin, xmax, 100)
pdf = stats.lognorm.pdf(x, s=439, scale=np.exp(198), loc=816)#816 + LOGN(198, 439)
plt.plot(x, pdf, 'r', label="Lognormal")
plt.legend()
plt.show()
I have no idea how I can make them the same size or look nice. I can't reale use the picture from Arena Software because i would like to plot multiple distributions into one picture. With a scipy.stats.fit I get somewhat better results. As in this post I tried following code:
s, loc, scale = stats.lognorm.fit(system20, floc=0)
#-> 0.19860417 0.0 967.8363
Solution:
The Output in Arena Software for the Lognormal distribution is in the form of (LogMean LogStd). In the docs there is actually a transformation to get the normal mean and std for easy replication of the distribution.
If you want to plot it with scipy.stats.lognorm: