Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
API_KEYS = {
'infura': "YOUR_INFURA_KEY",
'thegraph': "YOUR_THEGRAPH_KEY",
'etherscan': "YOUR_ETHERSCAN_KEY",
}
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.stats import beta as beta_dist
def credible_interval(t, f, prob=.5, prior='uniform'):
"""Calculates posterior credible interval for a beta-binomial model with prior `Beta(a, b)` after `t` successes in `t+f` trials.
@param t: Number of successes.