home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / nvdc87 / curvef / cfit2.eka < prev    next >
Text File  |  1987-09-02  |  1KB  |  56 lines

  1.  
  2. ; CFIT2.EKA
  3. ;
  4. ; version 1.0
  5. ; August 10, 1987
  6. ; Copyright (c) 1987 Namir Clement Shammas
  7. ;
  8. ; Least-square fitting between three or more variables
  9. ;
  10. ; general model is:
  11. ;
  12. ;     f(x1,...,xn) =  a0 + a1 f1(x1,...,xn) + a2 + f2(x1,...,xn) +
  13. ;                          an fn(x1,...,xn)
  14. ;
  15. ; examples:
  16. ;
  17. ; Simple models: no cross-product terms
  18. ; -------------------------------------
  19. ;
  20. ;   f(x1,x2)      = a0 + a1 * x1 + a2 * x2
  21. ;   f(x1,x2,x3)   = a0 + a1 * x1 + a2 * x2 + a3 * x3
  22. ;   f(x1,x2)      = a0 + a1 * Ln(x1) + a2 * sqrt(x2)
  23. ;   f(x1,x2,x3)   = a0 + a1 * x1^2 + a2 * x2 + a3 * Ln(x3)
  24. ;
  25. ; Advanced models: with cross-product terms
  26. ; -----------------------------------------
  27. ;
  28. ;  3-D surface
  29. ;   f(x1,x2) = a0 + a1 * x1 + a2 + x1^2 + b1 * x2 + b2 * x2^2 + c1
  30. ;
  31. ;   f(x1,x2,x3) = a0 + a1 * x1 * sqrt(x2) + a2 * Ln(x2) * x3^2
  32.  
  33. $ substlevel = 0
  34.  
  35. ; state selected model here
  36. f(x1,x2) = a0 + a1 * x1 + a2 * x1^2 + b1 * x2 + b2 * x2^2
  37.  
  38. f(1,1) = 11
  39. f(1,2) = 17
  40. f(1,3) = 27
  41. f(1,4) = 41
  42. f(2,1) = 7
  43. f(2,2) = 14
  44. f(2,3) = 25
  45. f(2,4) = 40
  46. f(3,1) = -1
  47. f(3,2) = 7
  48. f(3,3) = 19
  49. f(3,4) = 35
  50. f(4,1) = -13
  51. f(4,2) = -4
  52. f(4,3) = 9
  53. f(4,4) = 26
  54.  
  55.  
  56.