【Kurtosis】
[code]inputs:PriceValue( numericseries ),
Len( numericsimple ) ;
variables:
var0( 0 ),
var1( 0 ),
var2( 0 ),
var3( 0 ),
var4( 0 ) ;
Kurtosis = 0 ;
if Len > 3 then
begin
var3 = Average( PriceValue, Len ) ;
var4 = StandardDev( PriceValue, Len, 2 ) ;
if var4 > 0 then
begin
var1 = 0 ;
for Value1 = 0 to Len - 1
begin
var1 = var1 + Power( ( PriceValue[Value1] - var3 ) / var4, 4 ) ;
end ;
var0 = Len * ( Len + 1 ) / ( ( Len - 1 ) * ( Len - 2 ) *
( Len - 3 ) ) ;
var2 = 3 * Square( Len - 1 ) / ( ( Len - 2 ) * ( Len - 3 ) ) ;
Kurtosis = var0 * var1 - var2 ;
end ;
end ;
[/code]
页:
[1]