|
- 10 PRINT "EXPONENTIAL REGRESSION"
- 20 PRINT
- 30 PRINT "NUMBER OF KNOWN POINTS";
- 40 INPUT N
- 50 J=0
- 60 K=0
- 70 L=0
- 80 M=0
- 90 R2=0
- 99 REM - ENTER COORDINATES OF DATA POINTS
- 100 FOR I=1 TO N
- 110 PRINT "X,Y OF POINT";I;
- 120 INPUT X,Y
- 129 REM - ACCUMLATE INTERMEDIATE VALUES
- 130 Y=LOG(Y)
- 140 J=J+X
- 150 K=K+Y
- 160 L=L+X[2
- 170 M=M+Y[2
- 180 R2=R2+X*Y
- 190 NEXT I
- 199 REM - CALCULATE AND PRINT COEFFICIENTS OF EQUATION
- 200 B=(N*R2-K*J)/(N*L-J[2)
- 210 A=(K-B*J)/N
- 220 PRINT
- 230 PRINT "A =";EXP(A)
- 240 PRINT "B =";B
- 249 REM - CALCULATE REGRESSION TABLE VALUES
- 250 J=B*(R2-J*K/N)
- 260 M=M-K[2/N
- 270 K=M-J
- 280 PRINT
- 290 R2=J/M
- 300 PRINT "COEFFICIENT OF DETERMINATION (R[2) =";R2
- 310 PRINT "COEFFICIENT OF CORRELATION =";SQR(R2)
- 320 PRINT "STANDARD ERROR OF ESTIMATE =";SQR(K/(N-2))
- 330 PRINT
- 339 REM - ESTIMATE Y-VALUE FROM ENTERED X-VALUE
- 340 PRINT "INTERPOLATION: (ENTER X=0 TO END PROGRAM)"
- 350 PRINT "X =";
- 360 INPUT X
- 370 IF X=0 THEN 410
- 380 PRINT "Y =";EXP(A)*EXP(B*X)
- 390 PRINT
- 400 GOTO 350
- 410 END
|