On Thu, 2 Feb 2006, Seung Hun Han wrote:
How do i using EWMA or SMA method in gretl.
It's not something I've used, or something that gretl is set up to
handle automatically. You might look at
http://www.itl.nist.gov/div898/handbook/pmc/section3/pmc324.htm
The following gretl script reproduces the figure shown in that
tutorial (where "raw.txt" is a file containing nothing but the
"sample data" numbers from that page (in a column).
open raw.txt
setobs 1 1 --time-series
genr x = v1
scalar EWMA0 = 50
scalar s = 2.0539
scalar lambda = .3
scalar s_ewma = sqrt((lambda/(2-lambda)) * s^2)
series EWMA = EWMA0
EWMA = lambda * x + (1-lambda)*EWMA(-1)
scalar k = 3
series UCL = EWMA0 + k*s_ewma
series LCL = EWMA0 - k*s_ewma
fig1 <- gnuplot x EWMA UCL LCL time
fig1.show
Allin Cottrell