Skip to main content
variable edit and closing paranthesis
Source Link

I was looking for python, but stumbled upon this. So this would be useful for others like me.

Here is a python code to estimate beta parameters (according to the equations given above):

# estimate parameters of beta dist.
def getAlphaBeta(mu, sigma):
    alpha = mu**2 * ((1 - mu) / sigma**2 - 1 / mu)

    beta = alpha * (1 / mu - 1)

    return {"alpha": 0.5alpha, "beta": 0.1beta}


print(getAlphaBeta(0.5, 0.1))  # {alpha: 12, beta: 12}

You can verify the parameters $\alpha$ and $\beta$ by importing scipy.stats.beta package.

I was looking for python, but stumbled upon this. So this would be useful for others like me.

Here is a python code to estimate beta parameters (according to the equations given above):

# estimate parameters of beta dist.
def getAlphaBeta(mu, sigma):
    alpha = mu**2 * ((1 - mu) / sigma**2 - 1 / mu)

    beta = alpha * (1 / mu - 1)

    return {"alpha": 0.5, "beta": 0.1}


print(getAlphaBeta(0.5, 0.1)  # {alpha: 12, beta: 12}

You can verify the parameters $\alpha$ and $\beta$ by importing scipy.stats.beta package.

I was looking for python, but stumbled upon this. So this would be useful for others like me.

Here is a python code to estimate beta parameters (according to the equations given above):

# estimate parameters of beta dist.
def getAlphaBeta(mu, sigma):
    alpha = mu**2 * ((1 - mu) / sigma**2 - 1 / mu)

    beta = alpha * (1 / mu - 1)

    return {"alpha": alpha, "beta": beta}


print(getAlphaBeta(0.5, 0.1))  # {alpha: 12, beta: 12}

You can verify the parameters $\alpha$ and $\beta$ by importing scipy.stats.beta package.

context
Source Link

I was looking for python, but stumbled upon this. So this would be useful for others like me.

Here is a python code to estimate beta parameters (according to the equations given above):

# estimate parameters of beta dist.
def getAlphaBeta(mu, sigma):
    alpha = mu**2 * ((1 - mu) / sigma**2 - 1 / mu)

    beta = alpha * (1 / mu - 1)

    return {"alpha": 0.5, "beta": 0.1}


print(getAlphaBeta(0.5, 0.1)  # {alpha: 12, beta: 12}

You can verify the parameters $\alpha$ and $\beta$ by importing scipy.stats.beta package.

Here is a python code to estimate beta parameters (according to the equations given above):

# estimate parameters of beta dist.
def getAlphaBeta(mu, sigma):
    alpha = mu**2 * ((1 - mu) / sigma**2 - 1 / mu)

    beta = alpha * (1 / mu - 1)

    return {"alpha": 0.5, "beta": 0.1}


print(getAlphaBeta(0.5, 0.1)  # {alpha: 12, beta: 12}

You can verify the parameters $\alpha$ and $\beta$ by importing scipy.stats.beta package.

I was looking for python, but stumbled upon this. So this would be useful for others like me.

Here is a python code to estimate beta parameters (according to the equations given above):

# estimate parameters of beta dist.
def getAlphaBeta(mu, sigma):
    alpha = mu**2 * ((1 - mu) / sigma**2 - 1 / mu)

    beta = alpha * (1 / mu - 1)

    return {"alpha": 0.5, "beta": 0.1}


print(getAlphaBeta(0.5, 0.1)  # {alpha: 12, beta: 12}

You can verify the parameters $\alpha$ and $\beta$ by importing scipy.stats.beta package.

Source Link

Here is a python code to estimate beta parameters (according to the equations given above):

# estimate parameters of beta dist.
def getAlphaBeta(mu, sigma):
    alpha = mu**2 * ((1 - mu) / sigma**2 - 1 / mu)

    beta = alpha * (1 / mu - 1)

    return {"alpha": 0.5, "beta": 0.1}


print(getAlphaBeta(0.5, 0.1)  # {alpha: 12, beta: 12}

You can verify the parameters $\alpha$ and $\beta$ by importing scipy.stats.beta package.