【CovarEasy】
[code]inputs:Dep( numericseries ),
Len( numericsimple ) ;
variables:
var0( 0 ),
var1( 0 ),
var2( 0 ),
var3( 0 ) ;
if Len > 0 then
begin
var0 = 0.5 * ( Len - 1 ) ;
var1 = Average( Dep, Len ) ;
var2 = 0 ;
for var3 = 0 to Len - 1
begin
var2 = var2 + ( Len - var3 - var0 ) * ( Dep[var3] - var1 ) ;
end ;
CovarEasy = var2 / Len ;
end
else
RaiseRunTimeError( "Length input to CovarEasy function must be > 0" ) ;
[/code]
页:
[1]