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

st: nonlinearleastsquare


From   "Andreas Aschbacher" <aa_surf@gmx.at>
To   statalist@hsphsun2.harvard.edu
Subject   st: nonlinearleastsquare
Date   Thu, 13 Nov 2003 14:56:12 +0100 (MET)

Here is a brief description of my problem:  

I put all the following code into nlexample.do
~~~~~~~~~~~~~~~~
clear
set obs 100
gen x=uniform()                          
gen y=3 +.75/(1+exp(-2*x-0.1))          
                                                                            
  
capture program drop nlexample
program nlexample
version 8
if "`1'" == "?"{                //      alt+0145 1 alt+0146    <=>     for  
`1'  

 global S_1 "b c k A"                    
 global k = 1
 global A = 1
 global b = 1
 global c = 1
 exit
}
replace `1'=$b +$c/(1+exp(-$A*x-$k))    //     alt+0145 1 alt+0146    <=> 
for   `1'  
    
end
                                                                            
  
nl example y
~~~~~~~~~~~~~~~~~~~~~~~
at last I give :do nlexample: in command line- and I always get the
error-message
::: invalid name -  and I don't know why,
my ambition is to make nonlinear-fit for z(d) = a1*exp(-((d-a2)/a3)^2) +
a4*exp(-((d-a5)/a6)^2)
with LevenbergMarquardt therefore I need this example above.
Thank you for any help.  andreas

-- 
NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien...
Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService

Jetzt kostenlos anmelden unter http://www.gmx.net

+++ 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index