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