skew normal distribution in scipy

后端 未结 2 437
北恋
北恋 2020-12-08 07:37

Does anyone know how to plot a skew normal distribution with scipy? I supose that stats.norm class can be used but I just can\'t figure out how. Furthermore, how can I esti

2条回答
  •  时光说笑
    2020-12-08 08:14

    The accepted answer is more or less outdated, because a skewnorm function is now implemented in scipy. So the code can be written a lot shorter:

     from scipy.stats import skewnorm
     import numpy as np
     from matplotlib import pyplot as plt
    
     X = np.linspace(min(your_data), max(your_data))
     plt.plot(X, skewnorm.pdf(X, *skewnorm.fit(your_data))
    

提交回复
热议问题