home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / TURBOPAS / NONLIN.ZIP / NONLIN.DOC < prev    next >
Encoding:
Text File  |  1985-12-28  |  5.9 KB  |  131 lines

  1.  
  2.  
  3.  
  4.         Documentation for operating SIMPLEX -- nonlinear curve fitting routine
  5.  
  6.              Thσ codinτ oµ thσ simple° procedurσ i≤ froφ aε articlσ iε Bytσ ì
  7.         198┤ iε thσ Ma∙ issuσ writteε b∙ CacecΘ anΣ Cacheris«  Thσ articlσ ì
  8.         describe≤ thσ SIMPLE╪ algorithm«  I⌠ ha≤ beeε adapteΣ fo≥ TURB╧ PASCA╠ ì
  9.         V3.0▒ b∙ Toφ Dean¼ Dept« oµ Fores⌠ Resources¼ UtaΦ Statσ University«  ì
  10.         Thσ plottinτ routine≤ anΣ thσ bootstra≡ variancσ estimatσ routinσ wa≤ ì
  11.         addeΣ b∙ Toφ Dean¼ ╡ Deπ 198╡ a⌠ UtaΦ Statσ University.
  12.  
  13.              Simple° require≤ threσ file≤ t∩ bσ presen⌠ oε thσ defaul⌠ o≥ ì
  14.         loggeΣ drive║ SIMPLEX.PAS¼ NONFUNC.PAS¼ AN─ PARMS.DAT«  Thσ datß filσ ì
  15.         caε bσ oε an∙ drive«  SIMPLE╪ i≤ thσ maiε program« NONFUN├ contain≤ thσ ì
  16.         functioε definitioε anΣ PARMS.DA╘ has thσ use≥ specifieΣ contro∞ ì
  17.         parameters«  T∩ ruε thσ prograφ thσ functioε i≤ specifieΣ iε NONFUN├ ì
  18.         afte≥ "f:="«  Tw∩ varible≤ whicΦ arσ array≤ arσ useΣ iε thσ functioε ì
  19.         definition«  x[n▌ i≤ thσ parameter≤ t∩ bσ fitted« d[m▌ i≤ thσ data« ╬ ì
  20.         range≤ froφ ▒ t∩ thσ numbe≥ oµ estimateΣ parameters«  ═ range≤ froφ ▒ ì
  21.         t∩ thσ numbe≥ oµ independen⌠ variables«  Fo≥ example¼ thσ function
  22.  
  23.                   Y = A X1 + B(X2 X3)**C
  24.  
  25.         would look like in NONFUNC
  26.  
  27.                   f:= x[1]*d[1] + x[2] * exp(x[3]*ln(d[2]*d[3]));
  28.  
  29.              Afte≥ thσ funcitoε ha≤ beeε specifieΣ anΣ NONFUN├ saved¼ threσ ì
  30.         constant≤ neeΣ t∩ bσ defineΣ iε SIMPLE╪ t∩ matcΦ thσ function«  Thσ ì
  31.         firs⌠ specifie≤ thσ numbe≥ oµ parameter≤ t∩ bσ fitted-fo≥ this example¼ ì
  32.         thi≤ woulΣ bσ 3«  Thσ seconΣ state≤ thσ numbe≥ oµ values¼ includinτ thσ ì
  33.         dependen⌠ variable¼ presen⌠ oε eacΦ record¼ iε thi≤ casσ 4«  Thσ thirΣ ì
  34.         i≤ simpl∙ thσ numbe≥ oµ parameter≤ plu≤ one¼ herσ 4«  Thi≤ i≤ saveΣ anΣ ì
  35.         PARMS.DAT is edited. This file consists of 4 lines.
  36.  
  37.         LIN┼ 1║ maximuφ numbe≥ oµ iterations« 0=infinite«  Thσ prograφ alway≤ ì
  38.         converges¼ s∩ ╔ usσ 0«  Iµ nothinτ i≤ knowε abou⌠ thσ relatioε betweeε ì
  39.         the function and the data, I would use 100 to start with.
  40.  
  41.         LIN┼ 2║ guesse≤ a⌠ startinτ value≤ fo≥ eacΦ parameter«  Iµ thσ loτ wil∞ ì
  42.         be taken of a parameter it must not be zero.
  43.  
  44.         LIN┼ 3║ startinτ increment≤ fo≥ eacΦ parameter«  ╔ usuall∙ usσ onσ ì
  45.         orde≥ oµ magnitudσ lowe≥ thaε startinτ guesses«  Iµ aε overflo≈ erro≥ ì
  46.         occurs¼ ╔ decreasσ thσ increments« Smal∞ increment≤ wil∞ usuall∙ ì
  47.         increase the number of iterations needed to converge.
  48.  
  49.         LIN┼ 4║ convergencσ criteriß fo≥ eacΦ paramete≥ plu≤ onσ fo≥ thσ suφ oµ ì
  50.         square≤ oµ thσ residuals«  ╔ usσ 1e-4«  Iµ ß paramete≥ ha≤ troublσ ì
  51.         meetinτ thσ convergencσ criteria¼ ╔ wil∞ usσ 1e-2«  ╔ havσ neve≥ seeε ì
  52.         any need to use smaller criteria than 1e-4.
  53.  
  54.              Thσ prograφ i≤ read∙ t∩ run«  Thσ prograφ expect≤ thσ datß filσ t∩ ì
  55.         bσ ASCI╔ anΣ t∩ havσ thσ dependen⌠ variablσ a≤ thσ las⌠ iteφ iε each ìè        record«  I⌠ firs⌠ ask≤ fo≥ thσ datß filσ namσ anΣ wil∞ kee≡ askinτ ì
  56.         unti∞ ß valiΣ namσ i≤ entered«  I⌠ ask≤ iµ residua∞ plot≤ anΣ plot≤ oµ ì
  57.         observeΣ anΣ predicteΣ arσ needed«  Iµ file≤ oµ residual≤ anΣ fitteΣ ì
  58.  
  59.  
  60.                                         1
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.         value≤ arσ indicateΣ theε tw∩ file≤ arσ createΣ witΦ thσ extensioε ì
  70.         '.errº anΣ '.fitº appendeΣ t∩ thσ filσ name«  Thesσ havσ thσ origina∞ ° ì
  71.         value≤ anΣ eithe≥ thσ residua∞ o≥ predicteΣ ┘ iε placσ oµ thσ origina∞ ì
  72.         dependen⌠ values«  Thesσ caε bσ useΣ iε othe≥ programs«  Iµ outpu⌠ i≤ ì
  73.         also to go the printer a title is asked for.
  74.  
  75.              Anothe≥ featurσ tha⌠ i≤ kinΣ oµ burieΣ a⌠ thσ las⌠ oµ thσ prograφ ì
  76.         i≤ thσ abilit∙ t∩ producσ ß filσ witΦ paramete≥ estimate≤ deriveΣ froφ ì
  77.         thσ bootstra≡ technique«  Froφ thi≤ filσ variancσ estimate≤ oµ thσ ì
  78.         fitteΣ parameter≤ caε bσ obtained«  T∩ turε thi≤ featurσ oε se⌠ thσ ì
  79.         constan⌠ 'varianceº (fourtΦ linσ iε SIMPLEX.pas⌐ t∩ true¼ bu⌠ beware¼ ì
  80.         withou⌠ ß matΦ coprocesso≥ thi≤ caε takσ foreve≥ t∩ run«  Iε brief¼ thσ ì
  81.         bootstra≡ techniquσ sample≤ witΦ replacemen⌠ froφ thσ origina∞ datß t∩ ì
  82.         producσ ß ne≈ filσ witΦ thσ origina∞ numbe≥ oµ observations«  ì
  83.         Parameter≤ arσ estimateΣ froφ thi≤ datß se⌠ anΣ storeΣ iε ß filσ nameΣ ì
  84.         b:BOOTSTRA«  Thi≤ i≤ repeateΣ 10░ times«  Thσ standarΣ deviatioε oµ thσ ì
  85.         10░ repetition≤ fo≥ eacΦ paramete≥ i≤ ß nearl∙ unbiaseΣ estimato≥ oµ ì
  86.         it≤ standarΣ error«  Thi≤ procedurσ require≤ ß filσ calleΣ 'SAMPLEº oε ì
  87.         thσ a║ drivσ tha⌠ ha≤ 10░ datß set≤ oµ number≤ eacΦ se⌠ witΦ ß rangσ ì
  88.         equa∞ t∩ thσ origina∞ numbe≥ oµ observations«  Fo≥ example¼ iµ thσ datß ì
  89.         filσ ha≤ 1░ records¼ theε ß randoφ samplσ witΦ replacemen⌠ i≤ drawε ì
  90.         froφ ▒ t∩ 1░ s∩ tha⌠ thσ firs⌠ datß se⌠ migh⌠ consis⌠ oµ ì
  91.         1,5,6,3,8,4,7,4,10,5«  Thi≤ woulΣ selec⌠ thosσ recorΣ number≤ froφ thσ ì
  92.         origina∞ datß filσ t∩ ruε simple° on«  Therσ arσ 10░ sucΦ datß sets¼ ì
  93.         onσ afte≥ another¼ iε thσ filσ nameΣ SAMPLE«  Thi≤ prograφ expec⌠s thσ ì
  94.         SAMPL┼ filσ t∩ havσ thi≤ format:
  95.  
  96.         DATA SET  1
  97.         1 5 6 3 8 4 7 4 10 5
  98.  
  99.         DATA SET  2
  100.         2 5 8 4 2 1 7 3 5 2
  101.  
  102.         DATA SET 3
  103.         etc.
  104.  
  105.         ╔ usσ ß statisica∞ packagσ nameΣ MSUSTA╘ t∩ generatσ thσ SAMPL┼ file«  ì
  106.         MSUSTA╘ i≤ availablσ froφ R.E« LunΣ a⌠ Montanß Statσ Universit∙ iε ì
  107.         Bozeman¼ Montanß fo≥ abou⌠ $200«  I⌠ wil∞ als∩ d∩ thσ simplσ statistic≤ ì
  108.         t∩ calculatσ thσ standarΣ deviations«  Iµ yo⌡ d∩ no⌠ havσ somσ prograφ ì
  109.         t∩ generatσ thi≤ file¼ yo⌡ wil∞ neeΣ t∩ writσ ß uniforφ randoφ numbe≥ ìè        generato≥ tha⌠ wil∞ samplσ witΦ replacemen⌠ froφ ß giveε rangσ oµ ì
  110.         numbers.
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.                                         2
  126.  
  127.  
  128.  
  129.  
  130.  
  131.