Trailing-Edge
-
PDP-10 Archives
-
decuslib10-01
-
43,50110/fcst1.tuk
There are 2 other files named fcst1.tuk in the archive. Click here to see a list.
1' USE SYSTEM 'XBA'
2' MONTHLY DATA MUST BE SAVED UNDER YOUR USER NUMBER IN A
3' DATA FILE.
10 FILES FINPUT
20 PRINT "THIS PROGRAM USES MONTHLY DATA ONLY. DATA MUST BE ON DSK-FILE FINPUT.BAS";
50 PRINT
100 DIM A(20,12),B(20,12),D(20,12),E(12),F(12)
140 FOR M=1 TO 12
150 READ #1,A(N+1,M)
160 IF END #1 THEN 280
170 NEXT M
180 LET N=N+1
190 GOTO 140
280 LET S1 = 0
290 LET S2 = 0
300 LET S3 = 0
310 LET S4 = 0
320 LET S5 = 0
330 LET S6 = 0
340 FOR I = 1 TO N
350 FOR M= 1 TO 12
370 LET S1 = S1 + A(I,M)
380 LET S2 = S2 + (A(I,M)*A(I,M))
390 LET S3 = S3 + (A(I,M))*(((I-1)*12)+M)
400 LET S4 = S4 + (((I-1)*12)+M)*(((I-1)*12)+M)
410 LET S5 = S5 + 1
420 LET S6 = S6 + (((I-1)*12)+M)
430 NEXT M
440 NEXT I
450 LET B1= ((S5*S3)-(S1*S6))/((S5*S4)-(S6*S6))
460 LET A1= (S1-(B1*S6))/S5
470 PRINT "THE CALCULATED LINEAR TREND EQUATION IS: ";
480 PRINT "Y ="A1"+"B1"* X"
490 PRINT
500 LET B2 = A1
510 FOR I = 1 TO N
520 FOR M = 1 TO 12
530 LET B2 = B2 + B1
540 LET B(I,M) = A(I,M)/B2
550 NEXT M
560 NEXT I
640 LET V = 0
650 FOR M = 1 TO 12
660 LET E(M) = 0
670 FOR I = 1 TO N
680 LET E(M) = E(M) + B(I,M)
690 NEXT I
700 LET E(M) = E(M)/N
710 LET V = V + E(M)
720 NEXT M
730 LET V = 12/V
740 FOR M = 1 TO 12
750 LET E(M) = E(M)*V
760 NEXT M
800 PRINT "HOW MANY YEARS WOULD YOU LIKE TO FORECAST";
810 INPUT N1
820 PRINT
830 PRINT
840 PRINT "YEAR","MONTH","FORECAST","SEASONAL FACTOR"
850 FOR I = N TO N+N1-1
860 PRINT
865 LET V1 = V2 = 0
870 FOR M = 1 TO 12
880 LET F(M) = (A1 + B1*((I*12)+M))*E(M)
890 PRINT I+1,M,F(M),E(M)
900 LET V1 = V1 + F(M)
910 LET V2 = V2 + E(M)
920 NEXT M
925 PRINT
930 PRINT "TOTAL"," ",V1,V2
940 PRINT
950 NEXT I
999 END