Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import scipy.stats as st
- alpha = 0.05
- p = 1 - alpha
- dof = np.arange(5, 100)
- n = dof / 2.
- C_1 = 1 - alpha ** (1. / (n - 1))
- fval = st.f.ppf(p, 2, dof - 2)
- C_2 = fval / (n - 1. + fval)
- import matplotlib.pyplot as plt
- ax = plt.gca()
- ax.plot(dof, C_1, 'k-', lw=10, label=r'$1-alpha^{1/q}$')
- ax.plot(dof, C_2, 'r-', lw=5, label=r'$F_{2,2q}(alpha)/(F_{2,2q}(alpha)+q)$')
- ax.plot(dof, 6. / dof, 'b-', lw=2, label=r'$6/d$')
- ax.set_xlabel('Degrees of Freedom')
- ax.set_ylabel('{:0.0f}% Significance Level'.format(100 * p))
- ax.legend()
- ax.set_title(r"Coherence level for $alpha=0.05$")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement