perhaps this will do it:

smpl 1 20
series x=movavg(y,0.5) # change the parameter 0.5
smpl 21 25
series f=x[20]
matrix f_stats=fcstats(y,f)
f_stats
smpl full

where y is the series to forecast, f has the forecasts, x is the smoothed series and f_stats is the matrix with the forecast statistics. You can then plot y and f. For a moving average, set the parameter 0.5 to an integer>1.

On 15 October 2012 12:04, Data Analytics Corp. <walt@dataanalyticscorp.com> wrote:
Hi,

I'd like to illustrate for students forecasting for just a few
steps-ahead with simple exponential smoothing.  The filter option allows
for exponential smoothing (the movavg function does the same) but I
can't get a forecast with a forecast graph and forecast errors similar
to what I get with, say, the AR option in modeling.  In particular, if I
have 25 observations, I'd like to set the sample size to the first 20,
do the smoothing, forecast the next 5, graph all 25 along with the 5
forecasted values, and calculate error statistics for the 5 forecasted
values using the 5 hold-out values.  How can I do this?  Is there a
script that would accomplish what I want?  I'd like to also do the same
for a simple moving average.

Thanks,

Walt

________________________

Walter R. Paczkowski, Ph.D.
Data Analytics Corp.
44 Hamilton Lane
Plainsboro, NJ 08536
________________________
(V) 609-936-8999
(F) 609-936-3733
walt@dataanalyticscorp.com
www.dataanalyticscorp.com
_____________________________________________________
_______________________________________________
Gretl-users mailing list
Gretl-users@lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users