【StdErrorArray】
[code]inputs:PriceValueArray[MaxSize]( numericarray ),
Size( numericsimple ) ;
variables:
var0( 0 ),
var1( 0 ),
var2( 0 ),
var3( 0 ),
var4( 0 ),
var5( 0 ),
var6( 0 ) ;
StdErrorArray = 0 ;
if Size > 2 then
begin
var0 = Size * ( Size - 1 ) * .5 / Size ;
var1 = AverageArray( PriceValueArray, Size ) ;
var4 = 0 ;
var5 = 0 ;
var6 = 0 ;
for Value1 = 1 to Size
begin
var2 = ( Value1 - 1 ) - var0 ;
var3 = PriceValueArray[Value1] - var1 ;
var4 = var4 + Square( var2 ) ;
var5 = var5 + Square( var3 ) ;
var6 = var6 + var2 * var3 ;
end ;
Value2 = ( var5 - Square( var6 ) / var4 ) / ( Size - 2 ) ;
if Value2 > 0 then
StdErrorArray = SquareRoot( Value2 ) ;
end ;
[/code]
页:
[1]