Skip to content
Prev 78837 / 398502 Next

need suggestion about building formual

Have you considered writing a function to do the complex math and 
then calling nls referring to that function?  Consider the following 
(not tried):

expg <- function(a., x, G0, R, T){
	exp((a.[1]+(a.[2]*x)^(1/2)-G0)/(R*T))
}

mynls<-nls(formula=y~expg(a.=c(a, b), x=x, G0=G0, R=R, T=T),
       data=mydata,...)

	  If "nls" stops prematurely, I then write another function, "SSE" to 
compute the sum of squares of deviations from y and then ask "optim" to 
minimize "SSE", using "hessian=TRUE".  If you try this and have trouble 
making it work, please send another post.

	  spencer graves
Simple wrote: