【KurtosisArray】
[code]inputs:PriceValueArray[MaxSize]( numericarray ),
Size( numericsimple ) ;
variables:
var0( 0 ),
var1( 0 ),
var2( 0 ),
var3( 0 ),
var4( 0 ) ;
KurtosisArray = 0 ;
if Size > 3 then
begin
var3 = AverageArray( PriceValueArray, Size ) ;
var4 = StandardDevArray( PriceValueArray, Size, 2 ) ;
if var4 > 0 then
begin
var1 = 0 ;
for Value1 = 1 to Size
begin
var1 = var1 + Power( ( PriceValueArray[Value1] - var3 ) / var4, 4 ) ;
end ;
var0 = Size * ( Size + 1 ) / ( ( Size - 1 ) * ( Size - 2 ) * ( Size - 3 ) ) ;
var2 = 3 * Square( Size - 1 ) / ( ( Size - 2 ) * ( Size - 3 ) ) ;
KurtosisArray = var0 * var1 - var2 ;
end ;
end ;
[/code]
页:
[1]