ChipMaster's bwBASIC This also includes history going back to v2.10. *WARN* some binary files might have been corrupted by CRLF.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

47 lines
984 B

  1. 10 PRINT "EXPONENTIAL REGRESSION"
  2. 20 PRINT
  3. 30 PRINT "NUMBER OF KNOWN POINTS";
  4. 40 INPUT N
  5. 50 J=0
  6. 60 K=0
  7. 70 L=0
  8. 80 M=0
  9. 90 R2=0
  10. 99 REM - ENTER COORDINATES OF DATA POINTS
  11. 100 FOR I=1 TO N
  12. 110 PRINT "X,Y OF POINT";I;
  13. 120 INPUT X,Y
  14. 129 REM - ACCUMLATE INTERMEDIATE VALUES
  15. 130 Y=LOG(Y)
  16. 140 J=J+X
  17. 150 K=K+Y
  18. 160 L=L+X[2
  19. 170 M=M+Y[2
  20. 180 R2=R2+X*Y
  21. 190 NEXT I
  22. 199 REM - CALCULATE AND PRINT COEFFICIENTS OF EQUATION
  23. 200 B=(N*R2-K*J)/(N*L-J[2)
  24. 210 A=(K-B*J)/N
  25. 220 PRINT
  26. 230 PRINT "A =";EXP(A)
  27. 240 PRINT "B =";B
  28. 249 REM - CALCULATE REGRESSION TABLE VALUES
  29. 250 J=B*(R2-J*K/N)
  30. 260 M=M-K[2/N
  31. 270 K=M-J
  32. 280 PRINT
  33. 290 R2=J/M
  34. 300 PRINT "COEFFICIENT OF DETERMINATION (R[2) =";R2
  35. 310 PRINT "COEFFICIENT OF CORRELATION =";SQR(R2)
  36. 320 PRINT "STANDARD ERROR OF ESTIMATE =";SQR(K/(N-2))
  37. 330 PRINT
  38. 339 REM - ESTIMATE Y-VALUE FROM ENTERED X-VALUE
  39. 340 PRINT "INTERPOLATION: (ENTER X=0 TO END PROGRAM)"
  40. 350 PRINT "X =";
  41. 360 INPUT X
  42. 370 IF X=0 THEN 410
  43. 380 PRINT "Y =";EXP(A)*EXP(B*X)
  44. 390 PRINT
  45. 400 GOTO 350
  46. 410 END