# Thread: help with derivation

1. ## [SOLVED] help with derivation

I have spent hours on this and cant see where Im going wrong. First before I explain my problem here is the formula that I am working with...

$\tau^2=\frac{Q-n+1}{C}$

where

$Q=\sum^{n}_{i=1}(w_{i}\theta_{i}^2)-\frac{(\sum^{n}_{i=1}(w_{i}\theta_{i}))^2}{\sum^{n }_{i=1}(w_{i})}$

$C=\sum^{n}_{i=1}(w_{i})-\frac{\sum^{n}_{i=1}(w_{i}^2)}{\sum^{n}_{i=1}(w_{i })}$

$w_{i}$ and $\theta_{i}$ are known values
$w_{i}=w_{1}, w_{2}, ... , w_{n}$
$\theta_{i}=\theta_{1}, \theta_{2}, ... , \theta_{n}$

I want to know how to change $\tau^2$ to a set value by adding another $\theta$ and w, which I will denote $\theta_0$ and $w_0$. I appreciate this is a 2-dimensional problem so I would like to know the value of $\theta_0$ which would make $\tau^2$= a given value if I also set $w_0$ to be a given value. To do this I have tried to derive an equation in the form $\theta_0=f(\tau^2,w_0)$ where f is some function.

Given the 'extra values' $\theta_0$ and $w_0$, the formula for $\tau^2$ now becomes...

$\tau^2=\frac{Q-n}{C}$

where

$Q=\sum^{n}_{i=1}(w_{i}\theta_{i}^2)+w_0\theta_0^2-\frac{(\sum^{n}_{i=1}(w_{i}\theta_{i})+w_0\theta_0 )^2}{\sum^{n}_{i=1}(w_{i})+w_0}$

$C=\sum^{n}_{i=1}(w_{i})+w_0-\frac{\sum^{n}_{i=1}(w_{i}^2)+w_0^2}{\sum^{n}_{i=1 }(w_{i})+w_0}$

$w_{i}$ and $\theta_{i}$ are known values
$w_{i}=w_{1}, w_{2}, ... , w_{n}$
$\theta_{i}=\theta_{1}, \theta_{2}, ... , \theta_{n}$

To simplify things, let

$v=\sum^{n}_{i=1}(w_{i}^2)$
$x=\sum^{n}_{i=1}(w_{i}\theta_{i})$
$y=\sum^{n}_{i=1}(w_{i})$
$z=\sum^{n}_{i=1}(w_{i}\theta_{i}^2)$

which can all be evaluated given we have values for $w_{i}$ and $\theta_{i}$. So, now for the derivation...

$\tau^2= \frac{z+w_0\theta_0^2-\frac{(x+w_0\theta_0)^2}{y+w_0}-n}{y+w_0-\frac{v + w_0^2}{y+w_0}}$

$\tau^2(y+w_0-\frac{v + w_0^2}{y+w_0}) = z+w_0\theta_0^2-\frac{(x+w_0\theta_0)^2}{y+w_0}-n$

$\tau^2(y+w_0-\frac{v + w_0^2}{y+w_0}) = \theta_0^2(\frac{yw_0}{y+w_0})-\theta_0(\frac{2xw_0}{y+w_0}) +z - n - \frac{x^2}{y+w_0}$

$\tau^2(y+w_0-\frac{v + w_0^2}{y+w_0})(\frac{y+w_0}{yw_0}) = (\theta_0-\frac{x}{y})^2 + (\frac{y+w_0}{yw_0}) (z - n - \frac{x^2}{y+w_0})-0.25(\frac{2x}{y})^2$

$\tau^2(y+w_0-\frac{v + w_0^2}{y+w_0})(\frac{y+w_0}{yw_0}) -(\frac{y+w_0}{yw_0}) (z - n - \frac{x^2}{y+w_0})+0.25(\frac{2x}{y})^2= (\theta_0-\frac{x}{y})^2$

$\theta_0=\frac{x}{y} \pm \sqrt(\tau^2(y+w_0-\frac{v + w_0^2}{y+w_0})(\frac{y+w_0}{yw_0}) -(\frac{y+w_0}{yw_0}) (z - n - \frac{x^2}{y+w_0})+(\frac{x}{y})^2)$

Everything seems right but when I test it by finding $\theta_0$ and substituting back into the $\tau^2$ formula I am not getting the right result for $\tau^2$. Where am I going wrong???

Any help much appreciated.