I have an equation that I want to try and solve iteratively. I don't have any background in numerical analysis so unsure as to how to go about it. Any help would be greatly appreciated. My equation is:
$\hat{\tau}^2 = \left. \sum\limits_{i=1}^k \frac{\left(y_i - \left( \left. \sum\limits_{i=1}^k \frac{y_i}{\hat{\sigma}_i^2 + \hat{\tau}^2} \right/ \left. \sum\limits_{i=1}^k \frac{1}{\hat{\sigma}_i^2 + \hat{\tau}^2} \right. \right)\right)^2 - \hat{\sigma}_i^2}{(\hat{\sigma}_i^2 + \hat{\tau}^2)^2} \right/ \left. \sum\limits_{i=1}^k \frac{1}{(\hat{\sigma}_i^2 + \hat{\tau}^2)^2} \right.$
I want to try and find $\hat{\tau}^2$ but not sure how to go about doing this.
Also how would I do this in a computer programme/what would be the best computer programme to use for doing it?
Many thanks for the help.
EDIT, just to go through how I have got to this point.
$Y_i \sim \mathcal{N}(\mu, \hat{\sigma}_i^2 + \tau^2)$ where $Y_i$ is termed the effect size. This is a Meta-Analysis term but is basically just an odds ratio.
$f(y|\mu, \tau^2) = \frac{1}{\sqrt{2\pi(\hat{\sigma}_i^2 + \tau^2)}}\mbox{ exp}\left(\frac{-(y-\mu)^2}{2(\hat{\sigma}_i^2 + \tau^2)}\right)$
$L(\mu, \tau^2) = -\frac{1}{2}\sum\limits_{i=1}^k \mbox{log}(2\pi(\sigma_i^2 + \tau^2)) - \frac{1}{2}\sum\limits_{i=1}^k \frac{(y_i-\mu)^2}{\sigma_i^2 + \tau^2}$
By taking partial derivatives and setting to zero, I have got that:
$\hat{\mu} = \left. \sum\limits_{i=1}^k \frac{y_i}{\hat{\sigma}_i^2 + \hat{\tau}^2} \right/ \left. \sum\limits_{i=1}^k \frac{1}{\hat{\sigma}_i^2 + \hat{\tau}^2} \right.$
$\hat{\tau}^2 = \left. \sum\limits_{i=1}^k \frac{(y_i - \hat{\mu})^2 - \hat{\sigma}_i^2}{(\hat{\sigma}_i^2 + \hat{\tau}^2)^2} \right/ \left. \sum\limits_{i=1}^k \frac{1}{(\hat{\sigma}_i^2 + \hat{\tau}^2)^2} \right.$
From this point, given data which will give me values for the $y_i$ and the $\sigma_i$ I want to compute $\hat{\mu}$ and $\hat{\tau}^2$.
I thought that the best thing to do would be to plug in the formula of $\hat{\mu}$ into the forumla for $\hat{\tau}^2$ so I only had one equation to solve.
Hence why I got:
$\hat{\tau}^2 = \left. \sum\limits_{i=1}^k \frac{\left(y_i - \left( \left. \sum\limits_{i=1}^k \frac{y_i}{\hat{\sigma}_i^2 + \hat{\tau}^2} \right/ \left. \sum\limits_{i=1}^k \frac{1}{\hat{\sigma}_i^2 + \hat{\tau}^2} \right. \right)\right)^2 - \hat{\sigma}_i^2}{(\hat{\sigma}_i^2 + \hat{\tau}^2)^2} \right/ \left. \sum\limits_{i=1}^k \frac{1}{(\hat{\sigma}_i^2 + \hat{\tau}^2)^2} \right.$