help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Weighted Moving Average


From: Daniel Oberhoff
Subject: Re: Weighted Moving Average
Date: Fri, 10 Aug 2007 09:55:55 +0200

An online method to do wma (i.e. where you can add a single value at once) with an expinential window (which weighs more recent events stronger than less recent ones) works like this:

init:

x_mean(0) = x(0);

update:

x_mean(t+1) = exp(-1/tau) * (x_mean(t) + x(t) / tau);


this gives you a wma of x(t). Tau is something like the length of the memory (events further back than tau will not be "remembered" too well).


Best

Daniel Oberhoff

Am 10.08.2007 um 09:19 schrieb Luca Delucchi:

Hi, I can do a function on Weighted Moving Average where the value are
take in automatic mode? this my idea

#y=[y1,y2,y3,y4,y5]
function wma(y)
(y1+2*y2+y3)/4
(y2+2*y3+y4)/4
etc
etc
end function

I could not repeat the formula (y1+2*y2+y3)/4 (because if the long of
vector is different i must change the function) but have only one
formula that use the formula for all values of vector

I hope I've given a clear explanation

Luca
_______________________________________________
Help-octave mailing list
address@hidden
https://www.cae.wisc.edu/mailman/listinfo/help-octave



reply via email to

[Prev in Thread] Current Thread [Next in Thread]