Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-01 - 43,50110/fcstst.tuk
There are 2 other files named fcstst.tuk in the archive. Click here to see a list.
1 PRINT "THIS PROGRAM SIMULATES A TIME SERIES AND STORES ITS OUTPUT"
2 PRINT "   IN TWO FILES:MON AND YEAR."
3 PRINT
4 PRINT
5 RANDOMIZE
10 DIM S(12),X(200),Z(200)
20 FILES MON;YEAR
42 SCRATCH #1
44 SCRATCH #2
45 PRINT "DO YOU WANT SEASONALS";
46 INPUT A$
47 IF A$ = "NO" THEN 152
48 PRINT
49 PRINT
50 PRINT "MONTH","SEASONAL INDEX"
90 LET V=W=0
100 FOR I = 1 TO 12
105  LET S = RND*.3-.15
110  LET S = INT(100*S)/100
120  LET S(I) = 1+S
122  LET V = V+S
125  IF I<12 THEN 140
130  LET S(I) = S(I)-V
140  PRINT I,S(I)
145  LET W = W+S(I)
150 NEXT I
151 GO TO 160
152 FOR I = 1 TO 12
153   LET S(I) = 1
154 NEXT I
155 GO TO 171
160 PRINT
170 PRINT "TOTAL",W
171 PRINT
172 PRINT
173 PRINT "ENTER FIGURES FOR:"
174 PRINT "   VALUE IN MONTH 0";
175 INPUT A
176 PRINT "   GROWTH IN EACH MONTH";
177 INPUT B
178 PRINT "   STANDARD DEVIATION OF RANDOM TERM";
179 INPUT U1
180 PRINT "   NUMBER OF YEARS TO BE GENERATED";
181 INPUT N1
183 PRINT
184 PRINT "DO YOU WANT A PRINT OUT OF DATA";
185 INPUT A$
186 IF A$="NO" THEN 210
187 PRINT
188 PRINT
190 PRINT "PERIOD","OBSERVATION"
210 LET J = 1
220 FOR Y = 1 TO N1
222  LET Z(Y) = 0
230  FOR I = 1 TO 12
235  LET U = ((-2*LOG(RND))^.5)*COS(6.283*(RND))
237  LET U = U*U1
240  LET X(J) = (A+B*J)*S(I)+U
242  IF A$="NO" THEN 255
250   PRINT J,X(J)
255   WRITE #1,X(J);
257   LET Z(Y) = Z(Y)+X(J)
260   LET J = J+1
270  NEXT I
275  WRITE #2,Z(Y)
280 NEXT Y
99999 END