Date: Thu, 21 Oct 2010 17:19:19 -0200
Reply-To: Ricardo Gonçalves da Silva
<rgs.rsilva@BANCOVOTORANTIM.COM.BR>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Ricardo Gonçalves da Silva
<rgs.rsilva@BANCOVOTORANTIM.COM.BR>
Subject: RES: Newton-Raphson in SAS?
In-Reply-To: <8DE344F230A946409D021626F849A0482193AF8421@WAFEDIXMCMS12.corp.weyer.pri>
Content-Type: text/plain; charset="iso-8859-1"
Thanks Jordan!
-----Mensagem original-----
De: Jordan, Lewis [mailto:Lewis.Jordan@weyerhaeuser.com]
Enviada em: quinta-feira, 21 de outubro de 2010 17:12
Para: Ricardo Gonçalves da Silva; SAS-L@LISTSERV.UGA.EDU
Assunto: RE: Newton-Raphson in SAS?
This should work...
DATA DADOS;
length type$ 10;
type="Observed";
INPUT Yi Xi;
CARDS;
151 5
52 1
20 0
;
proc sort;by xi;
proc print;
run;
data sim;
length type$ 10;
type="Predicted";
do xi=0 to 5 by .1;
yi=.;
output;
end;
run;
data fit;set dados sim;
run;
proc nlin data=fit;
parms k .001;
mean=(1-exp(-k*xi))/(1-exp(-k));
model yi=mean;
output out=predictions;
id mean;
run;
goptions reset=all;
proc gplot data=predictions;
symbol1 i=none v=dot c=black;
symbol2 i=join v=none c=blue l=1 w=2;
plot mean*xi=type;
run;quit;
*****************************
Lewis Jordan
Weyerhaeuser:
Southern Timberlands R&D
Cell (Primary): 662-889-4514
Office: 662-245-5227
lewis.jordan@weyerhaeuser.com
*****************************
-----Original Message-----
From: Ricardo Gonçalves da Silva [mailto:rgs.rsilva@bancovotorantim.com.br]
Sent: Thursday, October 21, 2010 2:07 PM
To: Jordan, Lewis; SAS-L@LISTSERV.UGA.EDU
Subject: RES: Newton-Raphson in SAS?
Exactly. My function is
y_i=[1-exp(-k*x_i)]/[1-exp(-k)]
I need to minimize RMSE:
RMSE=y_i-[1-exp(-k*x_i)]/[1-exp(-k)]
Rick
-----Mensagem original-----
De: Jordan, Lewis [mailto:Lewis.Jordan@weyerhaeuser.com]
Enviada em: quinta-feira, 21 de outubro de 2010 17:05
Para: Ricardo Gonçalves da Silva; SAS-L@LISTSERV.UGA.EDU
Assunto: RE: Newton-Raphson in SAS?
You have your function as:
(1-exp(-k*x_i)/1-exp(-k)) = 1 - exp(-k*x_i) - exp(-k)
Should it be:
[1-exp(-k*x_i)]/[1-exp(-k)]???
*****************************
Lewis Jordan
Weyerhaeuser:
Southern Timberlands R&D
Cell (Primary): 662-889-4514
Office: 662-245-5227
lewis.jordan@weyerhaeuser.com
*****************************
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Ricardo Gonçalves da Silva
Sent: Thursday, October 21, 2010 1:52 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Newton-Raphson in SAS?
Hi,
I need to minimize the root mean squared error (RMSE) of a nonlinear function given by:
RMSE=sqrt[(1/n)*sum_1_n[y_i-(1-exp(-kx_i)/1-exp(-k))]]**2, n=1,2,3.
DATA DADOS;
INPUT Yi Xi;
CARDS;
151 5
52 1
20 0
;
run;
The paper I'm following, the author uses Newton-Raphson method with first and the second derivatives to find k.
Can SAS handle with this problem? Any hints?
I remember I did it a long ago with Matlab, but this last handle with numeric derivatives directly.
Thanks
Ricardo
Esta mensagem e seus anexos podem conter informações confidenciais ou privilegiadas. Se você não é o destinatário dos mesmos você não está autorizado a utilizar o material para qualquer fim. Solicitamos que você apague a mensagem e avise imediatamente ao remetente. O conteúdo desta mensagem e seus anexos não representam necessariamente a opinião e a intenção da empresa, não implicando em qualquer obrigaçâo ou responsabilidade da parte da mesma.
This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. The contents of this message and its attachments do not necessarily express the opinion or the intention of the company, and do not implies any legal obligation or responsibilities from this company.
Esta mensagem e seus anexos podem conter informações confidenciais ou privilegiadas. Se você não é o destinatário dos mesmos você não está autorizado a utilizar o material para qualquer fim. Solicitamos que você apague a mensagem e avise imediatamente ao remetente. O conteúdo desta mensagem e seus anexos não representam necessariamente a opinião e a intenção da empresa, não implicando em qualquer obrigaçâo ou responsabilidade da parte da mesma.
This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. The contents of this message and its attachments do not necessarily express the opinion or the intention of the company, and do not implies any legal obligation or responsibilities from this company.
Esta mensagem e seus anexos podem conter informações confidenciais ou privilegiadas. Se você não é o destinatário dos mesmos você não está autorizado a utilizar o material para qualquer fim. Solicitamos que você apague a mensagem e avise imediatamente ao remetente. O conteúdo desta mensagem e seus anexos não representam necessariamente a opinião e a intenção da empresa, não implicando em qualquer obrigaçâo ou responsabilidade da parte da mesma.
This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. The contents of this message and its attachments do not necessarily express the opinion or the intention of the company, and do not implies any legal obligation or responsibilities from this company.