TSDecay 函数对其自变量计算衰变函数。
TSDecay(current_value smallfloat,
initial_value smallfloat,
decay_factor smallfloat)
returns smallfloat;
TSDecay(current_value double precision,
initial_value double precision,
decay_factor double precision)
returns double precision;
全部三个自变量必须是相同类型。
i
((decayi)initial)+∑((vj)decayi-j)
j=i
在此计算中,i 是到目前为止调用函数的次数,vj 是在第 j 次调用中调用它所使用的值。
只有在 Apply 函数内使用时此函数才有用。
衰变函数的结果。
create function ESA18(a smallfloat) returns smallfloat; return (.18 * a) + TSDecay(.18 * a, a, .82); end function;