TheAceHome

Untitled

Feb 12th, 2020
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. 1.4
  2. import numpy as np
  3. import matplotlib.pyplot as plt
  4. import scipy.stats as stats
  5.  
  6. x = np.arange(0,10,0.05)
  7. y = stats.chi2.pdf(x, 2)
  8. plt.plot(x, y, 'gray')
  9.  
  10. x = np.arange(0, 10, 0.05)
  11. y = stats.chi2.pdf(x, 3)
  12. plt.plot(x, y, 'orange')
  13.  
  14. x = np.arange(0, 10, 0.05)
  15. y = stats.chi2.pdf(x, 5)
  16. plt.plot(x, y, 'green')
  17.  
  18. x = np.arange(0, 10, 0.05)
  19. y = stats.chi2.pdf(x, 10)
  20. plt.plot(x, y, 'red')
  21.  
  22.  
  23. plt.show()
  24.  
  25. print(1-stats.chi2(20).cdf(10.9))
  26. print(stats.chi2(20).cdf(28.9))
  27. print(stats.chi2(25).cdf(31.4)-stats.chi2(25).cdf(8.26))
Advertisement
Add Comment
Please, Sign In to add comment