Skip to content

Instantly share code, notes, and snippets.

@Vayel
Last active August 24, 2018 08:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Vayel/d5c22bdd0f6f18b1612d563322ef0031 to your computer and use it in GitHub Desktop.
Save Vayel/d5c22bdd0f6f18b1612d563322ef0031 to your computer and use it in GitHub Desktop.
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import kstwobign
d_min, d_max = kstwobign.ppf(0.01), kstwobign.ppf(0.99)
d_vals = np.linspace(d_min, d_max, num=100)
cdf = kstwobign.cdf(d_vals)
fig, ax = plt.subplots()
ax.plot(d_vals, cdf, '-')
ax.set_xlabel('d')
ax.set_ylabel('CDF')
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.set_xlim([d_min, d_max])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment