【StdError】
[code]inputs:PriceValue( numericseries ),
Len( numericsimple ) ;
variables:
var0( 0 ),
var1( 0 ),
var2( 0 ),
var3( 0 ),
var4( 0 ),
var5( 0 ),
var6( 0 ) ;
StdError = 0 ;
if Len > 2 then
begin
var0 = Len * ( Len - 1 ) * .5 / Len ;
var1 = Average( PriceValue, Len ) ;
var4 = 0 ;
var5 = 0 ;
var6 = 0 ;
for Value1 = 0 to Len - 1
begin
var2 = Value1 - var0 ;
var3 = PriceValue[Value1] - var1 ;
var4 = var4 + Square( var2 ) ;
var5 = var5 + Square( var3 ) ;
var6 = var6 + var2 * var3 ;
end ;
Value2 = ( var5 - Square( var6 ) / var4 ) / ( Len - 2 ) ;
if Value2 > 0 then
StdError = SquareRoot( Value2 ) ;
end ;
[/code]
页:
[1]