home *** CD-ROM | disk | FTP | other *** search
-
-
-
- Documentation for operating SIMPLEX -- nonlinear curve fitting routine
-
- Thσ codinτ oµ thσ simple° procedurσ i≤ froφ aε articlσ iε Bytσ ì
- 198┤ iε thσ Ma∙ issuσ writteε b∙ CacecΘ anΣ Cacheris« Thσ articlσ ì
- describe≤ thσ SIMPLE╪ algorithm« I⌠ ha≤ beeε adapteΣ fo≥ TURB╧ PASCA╠ ì
- V3.0▒ b∙ Toφ Dean¼ Dept« oµ Fores⌠ Resources¼ UtaΦ Statσ University« ì
- Thσ plottinτ routine≤ anΣ thσ bootstra≡ variancσ estimatσ routinσ wa≤ ì
- addeΣ b∙ Toφ Dean¼ ╡ Deπ 198╡ a⌠ UtaΦ Statσ University.
-
- Simple° require≤ threσ file≤ t∩ bσ presen⌠ oε thσ defaul⌠ o≥ ì
- loggeΣ drive║ SIMPLEX.PAS¼ NONFUNC.PAS¼ AN─ PARMS.DAT« Thσ datß filσ ì
- caε bσ oε an∙ drive« SIMPLE╪ i≤ thσ maiε program« NONFUN├ contain≤ thσ ì
- functioε definitioε anΣ PARMS.DA╘ has thσ use≥ specifieΣ contro∞ ì
- parameters« T∩ ruε thσ prograφ thσ functioε i≤ specifieΣ iε NONFUN├ ì
- afte≥ "f:="« Tw∩ varible≤ whicΦ arσ array≤ arσ useΣ iε thσ functioε ì
- definition« x[n▌ i≤ thσ parameter≤ t∩ bσ fitted« d[m▌ i≤ thσ data« ╬ ì
- range≤ froφ ▒ t∩ thσ numbe≥ oµ estimateΣ parameters« ═ range≤ froφ ▒ ì
- t∩ thσ numbe≥ oµ independen⌠ variables« Fo≥ example¼ thσ function
-
- Y = A X1 + B(X2 X3)**C
-
- would look like in NONFUNC
-
- f:= x[1]*d[1] + x[2] * exp(x[3]*ln(d[2]*d[3]));
-
- Afte≥ thσ funcitoε ha≤ beeε specifieΣ anΣ NONFUN├ saved¼ threσ ì
- constant≤ neeΣ t∩ bσ defineΣ iε SIMPLE╪ t∩ matcΦ thσ function« Thσ ì
- firs⌠ specifie≤ thσ numbe≥ oµ parameter≤ t∩ bσ fitted-fo≥ this example¼ ì
- thi≤ woulΣ bσ 3« Thσ seconΣ state≤ thσ numbe≥ oµ values¼ includinτ thσ ì
- dependen⌠ variable¼ presen⌠ oε eacΦ record¼ iε thi≤ casσ 4« Thσ thirΣ ì
- i≤ simpl∙ thσ numbe≥ oµ parameter≤ plu≤ one¼ herσ 4« Thi≤ i≤ saveΣ anΣ ì
- PARMS.DAT is edited. This file consists of 4 lines.
-
- LIN┼ 1║ maximuφ numbe≥ oµ iterations« 0=infinite« Thσ prograφ alway≤ ì
- converges¼ s∩ ╔ usσ 0« Iµ nothinτ i≤ knowε abou⌠ thσ relatioε betweeε ì
- the function and the data, I would use 100 to start with.
-
- LIN┼ 2║ guesse≤ a⌠ startinτ value≤ fo≥ eacΦ parameter« Iµ thσ loτ wil∞ ì
- be taken of a parameter it must not be zero.
-
- LIN┼ 3║ startinτ increment≤ fo≥ eacΦ parameter« ╔ usuall∙ usσ onσ ì
- orde≥ oµ magnitudσ lowe≥ thaε startinτ guesses« Iµ aε overflo≈ erro≥ ì
- occurs¼ ╔ decreasσ thσ increments« Smal∞ increment≤ wil∞ usuall∙ ì
- increase the number of iterations needed to converge.
-
- LIN┼ 4║ convergencσ criteriß fo≥ eacΦ paramete≥ plu≤ onσ fo≥ thσ suφ oµ ì
- square≤ oµ thσ residuals« ╔ usσ 1e-4« Iµ ß paramete≥ ha≤ troublσ ì
- meetinτ thσ convergencσ criteria¼ ╔ wil∞ usσ 1e-2« ╔ havσ neve≥ seeε ì
- any need to use smaller criteria than 1e-4.
-
- Thσ prograφ i≤ read∙ t∩ run« Thσ prograφ expect≤ thσ datß filσ t∩ ì
- 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τ ì
- unti∞ ß valiΣ namσ i≤ entered« I⌠ ask≤ iµ residua∞ plot≤ anΣ plot≤ oµ ì
- observeΣ anΣ predicteΣ arσ needed« Iµ file≤ oµ residual≤ anΣ fitteΣ ì
-
-
- 1
-
-
-
-
-
-
-
-
- value≤ arσ indicateΣ theε tw∩ file≤ arσ createΣ witΦ thσ extensioε ì
- '.errº anΣ '.fitº appendeΣ t∩ thσ filσ name« Thesσ havσ thσ origina∞ ° ì
- value≤ anΣ eithe≥ thσ residua∞ o≥ predicteΣ ┘ iε placσ oµ thσ origina∞ ì
- dependen⌠ values« Thesσ caε bσ useΣ iε othe≥ programs« Iµ outpu⌠ i≤ ì
- also to go the printer a title is asked for.
-
- Anothe≥ featurσ tha⌠ i≤ kinΣ oµ burieΣ a⌠ thσ las⌠ oµ thσ prograφ ì
- i≤ thσ abilit∙ t∩ producσ ß filσ witΦ paramete≥ estimate≤ deriveΣ froφ ì
- thσ bootstra≡ technique« Froφ thi≤ filσ variancσ estimate≤ oµ thσ ì
- fitteΣ parameter≤ caε bσ obtained« T∩ turε thi≤ featurσ oε se⌠ thσ ì
- constan⌠ 'varianceº (fourtΦ linσ iε SIMPLEX.pas⌐ t∩ true¼ bu⌠ beware¼ ì
- withou⌠ ß matΦ coprocesso≥ thi≤ caε takσ foreve≥ t∩ run« Iε brief¼ thσ ì
- bootstra≡ techniquσ sample≤ witΦ replacemen⌠ froφ thσ origina∞ datß t∩ ì
- producσ ß ne≈ filσ witΦ thσ origina∞ numbe≥ oµ observations« ì
- Parameter≤ arσ estimateΣ froφ thi≤ datß se⌠ anΣ storeΣ iε ß filσ nameΣ ì
- b:BOOTSTRA« Thi≤ i≤ repeateΣ 10░ times« Thσ standarΣ deviatioε oµ thσ ì
- 10░ repetition≤ fo≥ eacΦ paramete≥ i≤ ß nearl∙ unbiaseΣ estimato≥ oµ ì
- it≤ standarΣ error« Thi≤ procedurσ require≤ ß filσ calleΣ 'SAMPLEº oε ì
- thσ a║ drivσ tha⌠ ha≤ 10░ datß set≤ oµ number≤ eacΦ se⌠ witΦ ß rangσ ì
- equa∞ t∩ thσ origina∞ numbe≥ oµ observations« Fo≥ example¼ iµ thσ datß ì
- filσ ha≤ 1░ records¼ theε ß randoφ samplσ witΦ replacemen⌠ i≤ drawε ì
- froφ ▒ t∩ 1░ s∩ tha⌠ thσ firs⌠ datß se⌠ migh⌠ consis⌠ oµ ì
- 1,5,6,3,8,4,7,4,10,5« Thi≤ woulΣ selec⌠ thosσ recorΣ number≤ froφ thσ ì
- origina∞ datß filσ t∩ ruε simple° on« Therσ arσ 10░ sucΦ datß sets¼ ì
- onσ afte≥ another¼ iε thσ filσ nameΣ SAMPLE« Thi≤ prograφ expec⌠s thσ ì
- SAMPL┼ filσ t∩ havσ thi≤ format:
-
- DATA SET 1
- 1 5 6 3 8 4 7 4 10 5
-
- DATA SET 2
- 2 5 8 4 2 1 7 3 5 2
-
- DATA SET 3
- etc.
-
- ╔ usσ ß statisica∞ packagσ nameΣ MSUSTA╘ t∩ generatσ thσ SAMPL┼ file« ì
- MSUSTA╘ i≤ availablσ froφ R.E« LunΣ a⌠ Montanß Statσ Universit∙ iε ì
- Bozeman¼ Montanß fo≥ abou⌠ $200« I⌠ wil∞ als∩ d∩ thσ simplσ statistic≤ ì
- t∩ calculatσ thσ standarΣ deviations« Iµ yo⌡ d∩ no⌠ havσ somσ prograφ ì
- t∩ generatσ thi≤ file¼ yo⌡ wil∞ neeΣ t∩ writσ ß uniforφ randoφ numbe≥ ìè generato≥ tha⌠ wil∞ samplσ witΦ replacemen⌠ froφ ß giveε rangσ oµ ì
- numbers.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 2
-
-
-
-
-
-