Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Add functions to calculate the pdf and cdf #57

Closed
wants to merge 1 commit into from

Conversation

zoj613
Copy link
Owner

@zoj613 zoj613 commented Mar 22, 2021

closes #54 and continues #56

In [6]: from polyagamma import polyagamma_pdf
   ...: import matplotlib.pyplot as plt
   ...: import numpy as np
   ...: plt.style.use("seaborn")
   ...: x = np.linspace(0.01, 3, 1000);x.sort()
   ...: for h, z in zip([1, 4, 7, 10, 15, 25], [10] * 6):
   ...:    a = polyagamma_pdf(x, h=h, z=z)
   ...:    plt.plot(x, a, label=f'PG({h}, {z})')
   ...: plt.xlabel('x')
   ...: plt.ylabel('f(x)')
   ...: plt.ylim(bottom=0)
   ...: plt.legend()
   ...: plt.show()

pdf's

Figure_pdf_0 Figure_pdf_10

cdf's

Figure_cdf_0 Figure_cdf_10

@codecov-io
Copy link

Codecov Report

Merging #57 (22d9ef8) into main (2af0edb) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main       #57   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines           98       122   +24     
=========================================
+ Hits            98       122   +24     
Impacted Files Coverage Δ
polyagamma/__init__.py 100.00% <100.00%> (ø)
polyagamma/_polyagamma.pyx 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2af0edb...22d9ef8. Read the comment docs.

@zoj613
Copy link
Owner Author

zoj613 commented Mar 25, 2021

#58 improves on this by implementing these directly without using slow numerical integration. so closing this.

@zoj613 zoj613 closed this Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ENH: Add logp and logcdf utiliy functions
2 participants