From: tedzzx <zengzhenxing_at_gmail.com>

Date: Mon, 17 Nov 2008 07:16:31 -0800 (PST)

}

Date: Mon, 17 Nov 2008 07:16:31 -0800 (PST)

Hi,all

I am doing a nonlinear regression and I am going to use nls. To Minimize:sum{(Y-BS(s,x,r,t,v)) ^2}

a<-nls(Y~BS(s,x,r,t,v))

BS is the black-scholes model.

BS<-function(s,x,r,t,v){

d1=(ln(s/x)+v^2*t/2)/(v*t^(0.5)) d2=(ln(s/x)-v^2*t/2)/(v*t^(0.5)) c=e^(rt)*(s*N(d1)-x*N(d2))

}

where s,x,r,t are known numbers

But v is dertermined by a linear regression:
ln(v)=a0+a1*n+a2*n^2

a0,a1 and a2 are the ones to be estimated.

How can write the code for these nonlinear regression?

thanks

Ted

-- View this message in context: http://www.nabble.com/How-to-solve-this-nonlinear-regression-problem--tp20541306p20541306.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help_at_r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.Received on Mon 17 Nov 2008 - 15:25:24 GMT

Archive maintained by Robert King, hosted by
the discipline of
statistics at the
University of Newcastle,
Australia.

Archive generated by hypermail 2.2.0, at Mon 17 Nov 2008 - 16:30:26 GMT.

*
Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help.
Please read the posting
guide before posting to the list.
*