# Numerically solve an equation using Python

How could I (numerically) solve this equation for $\alpha$ given $x_i$ (these are known) ?

$\sum_{i=1}^N\frac{1}{x_i-\alpha} = \frac{2N}{\sum_{i=1}^{N}(x_i-\alpha)^2}\sum_{i=1}^{N}{(x_i-\alpha)}$

In fact my aim is to solve the following system for $\alpha$ and $\beta$:

$\beta = \sqrt{\frac{\sum_{i=1}^N(x_i-\alpha)^2}{2N}} (1)$

$\sum_{i=1}^{N}\frac{1}{x_i-\alpha} = \frac{1}{\beta^2}\sum_{i=1}^{N}(x_i-\alpha) (2)$

Thus the very first equation is obtained where I put (1) in (2).

Equations (1) and (2) are obtained while solving for the maximum likelihood estimators the following distribution (special case of Weibull): $f(x) = \frac{x_i-\alpha}{\beta^2}e^{-\frac{(x_i-\alpha)^2}{2\beta^2}}$

• If you were given this as an assignment, then you were also given the tools neccessary to solve it. So what are your difficulties exactly? May 30, 2016 at 8:51
• That's not an assignment and that's why I have no idea to solve it. May 30, 2016 at 9:00
• i have updated the very first post. May 30, 2016 at 9:08
• I see. How large is $N$? It would make sense to give the value of $N$ at least, or the range of possible values. If $N$ is small, this is one case, and if $N$ is very large, this is quite another case May 30, 2016 at 9:53
• There was no square in (2), so now my first post is correct. How would you solve it? May 30, 2016 at 9:53