商業及經濟預測(大學部;下學期):相關網頁

*下載函數 *.gfn
下載 fcerr.gfn, find_best_ma.gfn, find_best_ewa.gfn:
[http://sites.google.com/site/gretlforubuntu/febook/smooth 按此前往]

==demo-de-Trend.inp==
[code]
nulldata 30
setobs 1 1 –time-series
set seed 89675430
series u = normal()
series y = uniform()
series A=2*time
ma3=movavg(A,3)
err1=A-ma3
ma33=movavg(ma3,3)
err2=ma3-ma33
f=ma3+err2
err3=A-f

fig1 <- gnuplot A ma3 ma33 f –with-lines –time-series –output=display

smpl 1 12
print -o A ma3 err1 ma33 err2
smpl full

series A1=time+ 1*u
series A2=time+ 2*u
series A3=time+ 3*u
series t0=time
figA1 <- gnuplot A1 t0 –with-lines –time-series –output=display
figA2 <- gnuplot A2 t0 –with-lines –time-series –output=display
figA3 <- gnuplot A3 t0 –with-lines –time-series –output=display
series A=2*time+ u
ma3=movavg(A,3)
err1=A-ma3
ma33=movavg(ma3,3)
err2=ma3-ma33
f=ma3+err2
err3=A-f
print -o A ma3 err1 ma33 err2
fig2 <- gnuplot A ma3 ma33 –with-lines –time-series –output=display
fig2.show
fig2f <- gnuplot A ma3 f –with-lines –time-series –output=display
fig2f.show

series AR1=0
series AR1=0.6*AR1(-1)+u

figA1.show
figA2.show
figA3.show
series myA3=2*movavg(A3(-1),2)-movavg(movavg(A3(-1),2),2)
include find_best_ma
include find_best_ewa

list retList = find_best_ma(A3)
list retList = find_best_ewa(A3)
[/code]

About yinung