(See Chan et al. 1983.) Show that the following updating algorithm for computing the sample mean and variance is really just the Givens method for the simplest regression problem ( just a common mean):
Ti = Ti−1 + yi and Si = Si−1 + (iyi − Ti) 2 /[i(i − 1)].
Show that it is equivalent to the following code:
s=0.
ss=0.
do i=1,n
d=(y(i)-s)/i
ss=ss+(i-1)*(y(i)-s)*d
s=s+d
end do ! loop on i
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here