[R] how to fit exponential curve such as a*b^t in r?

Jeff Newmiller jdnewmil at dcn.davis.CA.us
Mon Dec 16 09:25:41 CET 2013


Read the examples section of

?nls

You probably need to provide a start list of values.

There are some points you should note from the Posting Guide mentioned in the footer of emails on this list: this is not a homework help forum, you should provide a reproducible example, and you should not post in HTML format.
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.

"水静流深" <1248283536 at qq.com> wrote:
>input <- "    
>      t    y    
>     1  5.3    
>     2  7.2    
>     3  9.6    
>     4 12.9    
>     5 17.1    
>     6 23.2"         
>    dat<-read.table(textConnection(input),header=TRUE,sep="")    
>    t<-dat[,1]    
>    y<-dat[,2]   
>
>`y=3.975*(1.341^t)` is the resule of fit,how can i use `nls` function
>to get it?
>	[[alternative HTML version deleted]]
>
>______________________________________________
>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.



More information about the R-help mailing list