Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: nonlinear-leastsquare


From   "Andreas Aschbacher" <[email protected]>
To   [email protected]
Subject   st: nonlinear-leastsquare
Date   Mon, 1 Dec 2003 10:45:44 +0100 (MET)

I have two columns in ascii-sheet :
x-col        y-col
1              34
2              45
3              44
... and so on         /experiment in radioactive measurement /

and the following program in a do-file:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
capture program drop nlexample
program nlexample
version 8
if "`1'" == "?" {
global S_1 "a1 a2 a3 a4 a5 a6"
global a1 = ...
global a2 = ....
global a3 = ....
global a4 = ....
global a5 = ...
global a6 = ....        " good start-values "
exit
}
replace `1' = $a1*exp(-((x-$a3)/$a2)^2) + $a4*exp(-((x-$a6)/$a5)^2) '
fitting twopeak-curve
end
*twoway line y x
nl example y x,level(95) leave eps(1e-o5) nolog trace iterate(15000)
delta(4e-12)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I reached convergence and good values for a1,a2,...with "right"start-values
above after long 'trying' ......
my questions::
1.) which parameter is the typical Marquardt-Parameter ?
2.) although in reference-book:what does query-call and what does
calculation-call mean ?
3.)after calling the program above with >do name< and after getting my
results I print: predict myvar
    then I  have  with the command :twoway line myvar x a passable
graph-fit,is this the correct way ?
andreas





-- 
Neu bei GMX: Preissenkung f�r MMS-Versand und FreeMMS!

Ideal f�r alle, die gerne MMS verschicken:
25 FreeMMS/Monat mit GMX TopMail.
http://www.gmx.net/de/cgi/produktemail

+++ GMX - die erste Adresse f�r Mail, Message, More! +++

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index