def gamma(**kwds):
    """Return the parameters of the gamma distribution (alpha, beta)
    given the mean and variance."""
    mean = kwds['mean']
    var = kwds['variance']
    beta = mean/var
    alpha = mean * beta
    return alpha, beta