The fact that T2 and V2 are of different lengths seems like a likely culprit. Other than that, you need to find start points that do not lead to a singular gradient. There are several books that provide advice on obtaining initial parameter estimates for non-linear models. Google Books might help you.
Cheers Andrew On Tue, May 03, 2011 at 09:08:03PM -0700, sterlesser wrote: > the original data are > V2 =c(371000,285000 ,156000, 20600, 4420, 3870, 5500 ) > T2=c( 0.3403 ,0.4181 ,0.4986 ,0.7451 ,1.0069 ,1.553) > nls2=nls(V2~v0*(1-epi+epi*exp(-cl*(T2-t0))),start=list(v0=10^7,epi=0.9,cl=6.2,t0=8.7)) > after execution error occurs as below > ################################################################ > Error in nlsModel(formula, mf, start, wts) : > singular gradient matrix at initial parameter estimates > Error in nlsModel(formula, mf, start, wts) : > singular gradient matrix at initial parameter estimates > In addition: Warning messages: > 1: In lhs - rhs : > longer object length is not a multiple of shorter object length > 2: In .swts * attr(rhs, "gradient") : > longer object length is not a multiple of shorter object length > > could anyone help me ?thansks > > -- > View this message in context: > http://r.789695.n4.nabble.com/nls-problem-with-R-tp3494454p3494454.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@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. -- Andrew Robinson Program Manager, ACERA Department of Mathematics and Statistics Tel: +61-3-8344-6410 University of Melbourne, VIC 3010 Australia (prefer email) http://www.ms.unimelb.edu.au/~andrewpr Fax: +61-3-8344-4599 http://www.acera.unimelb.edu.au/ Forest Analytics with R (Springer, 2011) http://www.ms.unimelb.edu.au/FAwR/ Introduction to Scientific Programming and Simulation using R (CRC, 2009): http://www.ms.unimelb.edu.au/spuRs/ ______________________________________________ R-help@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.