#calculate pdf values using the estimated parametersĮst_pdf = st.gamma.pdf(x=support, a=k_hat, scale=theta_hat)Īx.hist(sample, density=True, bins=100, color='blue', alpha=0.2)Īx.legend()Īx.fill_between(support, org_pdf, color="none", hatch="/", edgecolor="green")Īx.fill_between(support, est_pdf, color="none", hatch="|", edgecolor="orange")ĭistribution of the gamma sample (blue), the original distribution (green), and the estimated distribution (orange). Org_pdf = st.gamma.pdf(x=support, a=k, scale=theta) #calculate pdf values using the original parameters Easy, isn't it?įinally, we can visualize the estimated distribution and compare it with the sample and the original distribution: #generate some points along the x axis You can derive it using the formula: Katex ![]() The moment generating function (MGF) is just a fancy function specific to a particular probability distribution. I will use Gamma distribution to illustrate how to deal with not-so-easy functions and really make you grasp the concepts behind MM. Calculate the estimates of the parameters.In this tutorial, I am going to show you how to: ![]() ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |