home *** CD-ROM | disk | FTP | other *** search
- .MCD 20000 0
- .CMD PLOTFORMAT logs=0,0 subdivs=1,1 size=5,15 type=l
- .CMD FORMAT rd=d ct=10 im=i et=3 zt=15 pr=3 mass length time charge
- .CMD SET ORIGIN 0
- .CMD SET TOL 0.001000
- .CMD MARGIN 0
- .CMD LINELENGTH 78
- .CMD SET PRNCOLWIDTH 8
- .CMD SET PRNPRECISION 4
- .TXT 0 39 1 39
- a1,38,42,37
- Copyright (c) 1988 by MathSoft, Inc.
- .TXT 1 43 1 39
- a1,38,78,37
- /EQUATIONS FOR EXPONENTIAL SMOOTHING
- .TXT 1 -63 1 39
- a1,38,76,37
- FORECASTING BY EXPONENTIAL SMOOTHING
- .TXT 1 63 2 77
- a2,76,78,117
- These equations generate a time series x with normally distributed random
- shocks superimposed on a changing trend.
- .TXT 1 -81 2 80
- a2,79,77,149
- This application uses double exponential smoothing to forecast a time series.
- The plot shows the series x, the smoothed series p, and the errors e.
- .EQN 2 81 1 12
- i~1;30
- .EQN 0 21 1 12
- ORIGIN~1
- .TXT 1 -102 1 46
- a1,45,76,44
- Choose smoothing constants between 0 and 1:
- .EQN 0 48 1 8
- α~.3
- .EQN 0 13 1 8
- ß~.1
- .EQN 0 41 3 38
- d[i~\(-2*ln(rnd(1)))*cos(2*π*rnd(1))
- .TXT 1 -21 1 19
- a1,18,78,17
- normal deviates:
- .TXT 1 -81 1 16
- a1,15,77,14
- Read in data:
- .EQN 0 18 1 20
- x~READPRN(FDATA)
- .TXT 0 24 1 36
- a1,35,35,34
- components of prediction s and b:
- .EQN 2 -43 11 41
- 6&-2&x[i,p[i,e[i,0{1,1,10,28,l}@&1&i
- .EQN 0 43 2 36
- s[n~α*x[n+(1-α)*(s[(n-1)+b[(n-1))
- .TXT 0 39 1 15
- a1,14,78,13
- time series:
- .EQN 0 21 2 36
- x[i~1+.1*i+sin(.1*i)+.5*d[i
- .EQN 3 -60 2 36
- b[n~ß*(s[n-s[(n-1))+(1-ß)*b[(n-1)
- .TXT 0 39 2 77
- a2,76,76,111
- The initial values for smoothing use the average value and the trend over
- the first 5 elements of the series.
- .TXT 3 -39 1 33
- a1,32,32,31
- forecast for one period ahead:
- .EQN 0 39 1 11
- k~1;5
- .EQN 0 23 2 9
- h[k~x[k
- .EQN 0 19 2 8
- v[k~k
- .EQN 2 -75 2 17
- p[(n+1)~s[n+b[n
- .EQN 1 33 2 17
- b[1~slope(v,h)
- .EQN 0 23 2 21
- s[1~mean(h)-2*b[1
- .TXT 2 -62 1 21
- a1,20,76,19
- squared error sum:
- .EQN 0 23 1 9
- E=?
- .TXT 1 -65 1 15
- a1,14,76,13
- [Ctrl][PgDn]
- .TXT 0 80 1 15
- a1,14,78,13
- [Ctrl][PgDn]
- .TXT 1 0 1 67
- a1,66,78,65
- These equations iterate the smoothing simultaneously on a and b:
- .TXT 1 -79 5 75
- a5,74,74,351
- The sum of the squared prediction errors is one possible measure of the
- success of the prediction method. You can test the effect of using
- different smoothing constants by changing the values for α and ß and
- recalculating s and E. The plot of a tracking signal based on mean
- absolute deviations is shown below, with control limits at +6 and -6.
- .EQN 1 79 1 19
- n~2;length(x)
- .EQN 2 0 4 42
- ({2,1}÷b[n÷s[n)~({2,1}÷α*ß*(x[n-(s[(n-1)+b[(n-1)))+b[(n-1)÷α*x[n+(1-α)*(s[(n-1)+b[(n-1)))
- .EQN 3 -64 7 40
- 10&-10&T[j,6,-6{1,1,6,30,l}@&1&j
- .TXT 2 64 1 72
- a1,71,78,70
- These equations define the squared error sum E and tracking signal T:
- .EQN 1 -66 1 3
- .EQN 1 66 2 9
- p[1~s[1
- .EQN 0 16 2 18
- p[n~s[(n-1)+b[(n-1)
- .EQN 0 24 1 11
- e~x-p
- .EQN 2 -40 3 11
- E~{55}(e^2){49}
- .TXT 3 -79 2 78
- a2,77,76,119
- This application is based on material in the book Time Series Forecasting,
- by Bowerman and O'Connell (Duxbury Press).
- .TXT 1 78 1 15
- a1,14,78,13
- [Ctrl][PgDn]
- .EQN 2 1 1 19
- j~1;length(x)
- .EQN 2 0 9 26
- T[n~n*(j$(j≤n)*e[j)/(j$(j≤n)*|e[j)
-