LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (April 2006, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 13 Apr 2006 11:58:21 -0700
Reply-To:   Dale McLerran <stringplayer_2@YAHOO.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Dale McLerran <stringplayer_2@YAHOO.COM>
Subject:   Re: newton-rapson method
In-Reply-To:   <CA8F89971ADA9F47A6C915BA239784420D1DA3@MAILBE2.westat.com>
Content-Type:   text/plain; charset=iso-8859-1

We could also obtain the result using the procedure NLMIXED. NLMIXED can solve a nonlinear least squares problem. Still, I really like NLP for this rather than NLMIXED or PROC MODEL. It is just a matter of knowing what the procedure is doing well enough to properly specify the convergence criteria.

Dale

--- Ban Cheah <BanCheah@WESTAT.COM> wrote:

> Interestingly PROC MODEL returns 418 for Dale's example. > > -----Original Message----- > From: owner-sas-l@listserv.uga.edu > [mailto:owner-sas-l@listserv.uga.edu] > On Behalf Of Dale McLerran > Sent: Thursday, April 13, 2006 2:24 PM > To: SAS-L@LISTSERV.UGA.EDU > Subject: Re: newton-rapson method > > > --- lisiqi77@YAHOO.COM wrote: > > > Hi, Dale, > > > > I really appreciate your comment--clear and helpful. But about the > > last comment on the convergence criterion, I am puzzled why this > would > > > be a > > problem. I choose this value (0.005) since several other similar > > studies used it too. I constructed a dataset (where I know R is > 0.12) > > like the following: > > > > data sample; > > input B B1 B2 B3 ROE1 ROE2 ROE3 P; > > datalines; > > 20 30 40 50 0.20 0.30 0.40 120.89 > > 21 31 41 51 0.21 0.31 0.41 127.96 > > 22 32 42 52 0.22 0.32 0.42 135.19 > > ; > > proc print; > > run; > > > > The least square method works perfectly, but min ABS(P - g(R)) > gives > > something like (although it did give me correct R value): > > > > WARNING: Your program statements cannot be executed completely. > > NOTE: ABSCONV convergence criterion satisfied. > > NOTE: At least one element of the (projected) gradient is greater > than > > 1e-3. > > WARNING: In a total of 1 calls an error occurred during execution > of > > the program statements. > > NLP attempted to recover by using a shorter step size. > > > > > > So is this the convergence criterion problem you are worried about? > > > > > > Thanks! > > Tracy > > > > Hi Tracy, > > I did kind of leave that hanging. I'm not sure that this post > will provide complete enlightenment of my thoughts, but hopefully > it will point out the problems that need to be considered. If you > minimize ABS(P - f(R)), then your convergence criterion may be > adequate. However, if you use least squares, then you may need > more stringent convergence criterion. > > I don't have time for much discussion right now, but take a look > at the following example. Note that when I first constructed a > test set, I had large ROE1-ROE3 and small B1-B3, just the > opposite of what you show. My choice of parameters does demonstrate > the need for stricter convergence criteria. > > /* Generate P from specified R, ROE1-ROE3, B, and B1-B3 */ > data test; > b=8; > roe1 = 600; > b1=0.7; > roe2 = 300; > b2=1.3; > roe3 = 200; > b3 = 0.25; > r = 418; > > P = B + (ROE1-R)*B1/(1+R) + > (ROE2-R)*B2/((1+R)**2) + > (ROE3-R)*B3/(R*((1+R)**2)); > output; > drop r; > run; > > > /* Invoke NLP to solve for R using LSQ criterion. */ > /* Convergence criterion is ABSXCONV=0.005. Note */ > /* that NLP indicates convergence meeting */ > /* ABSGCONV criterion but finds R=417.41. */ > proc nlp data=test absxconv=0.005 ; > bounds R >= 0; > lsq f; > decvar r=1; > f = (P -( B + (ROE1-R)*B1/(1+R) + > (ROE2-R)*B2/(1+R)**2 + > (ROE3-R)*B3/(R*(1+R)**2))); > run; > > > /* Invoke NLP again, but specify more stringent */ > /* criterion for gradient convergence. */ > proc nlp data=test absxconv=0.005 absgconv=1E-8; > bounds R >= 0; > lsq f; > decvar r=1; > f = (P -( B + (ROE1-R)*B1/(1+R) + > (ROE2-R)*B2/(1+R)**2 + > (ROE3-R)*B3/(R*(1+R)**2))); > run; > > > I don't pretend to know what represents optimal values for the > convergence criteria. However, if you want ABS(P - f(R)) within > 0.005 (which means [P - f(R)]^2<0.000025 when using LSQ objective > function), NLP may terminate due to some other criterion before > you meet the criterion that you specifically state. > > Hope this helps clarify the problem. > > Dale > > > --------------------------------------- > Dale McLerran > Fred Hutchinson Cancer Research Center > mailto: dmclerra@NO_SPAMfhcrc.org > Ph: (206) 667-2926 > Fax: (206) 667-5977 > --------------------------------------- > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com >

--------------------------------------- Dale McLerran Fred Hutchinson Cancer Research Center mailto: dmclerra@NO_SPAMfhcrc.org Ph: (206) 667-2926 Fax: (206) 667-5977 ---------------------------------------

__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com


Back to: Top of message | Previous page | Main SAS-L page