[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to calculate STDev?



PureBytes Links

Trading Reference Links

>     STDEV = SquareRoot(SumX2 - 2*SumX*(SumX/Ntrades) +
>                        Ntrades*square(SumX/Ntrades));
> 
> I *think* that SD calculation is correct.   

Whoops.  No it's not.  I goofed when translating it from Excel.

Avg = SumX/Ntrades;
STDEV = SquareRoot(
         (SumX2 - 2*SumX*Avg + Ntrades*square(Avg)) / (Ntrades-1)
                  );

...should be closer, or

STDEV = SquareRoot((SumX2 - square(SumX)/Ntrades) / (Ntrades-1));

which is equivalent.

Gary