Re: [R] Obtain gradient at multiple values for exponetial decay model

2018-04-05 Thread David Winsemius
> On Apr 5, 2018, at 2:00 PM, g l wrote: > >> Sent: Thursday, April 05, 2018 at 4:40 PM >> From: "Jeff Newmiller" >> >> the coef function. >> > > For the benefit of other novices, used the following command to read the > documentation: > > ?coef > > Then tried and obtained: > >> cvalue10

Re: [R] Obtain gradient at multiple values for exponetial decay model

2018-04-05 Thread Jeff Newmiller
Try coef( graphmodeld ) And you don't need to approximate if you use the newdata argument to the predict function. I think reading the "Introduction to R" that comes with R would help. -- Sent from my phone. Please excuse my brevity. On April 5, 2018 2:00:45 PM PDT, g l wrote: >> Sent: Thurs

Re: [R] Obtain gradient at multiple values for exponetial decay model

2018-04-05 Thread g l
> Sent: Thursday, April 05, 2018 at 4:40 PM > From: "Jeff Newmiller" > > the coef function. > For the benefit of other novices, used the following command to read the documentation: ?coef Then tried and obtained: > cvalue100<-coef(graphmodelp~100) > cvalue100 NULL Then looked at the model

Re: [R] Obtain gradient at multiple values for exponetial decay model

2018-04-05 Thread Jeff Newmiller
This smells like homework, which the Posting Guide indicates is off topic. I am not aware of "the function" that will solve this, but if you know what a gradient is analytically then you should be able to put together a solution very similar to the code you already have with the addition of usin

[R] Obtain gradient at multiple values for exponetial decay model

2018-04-05 Thread g l
Readers, Data set: t,c 0,100 40,78 80,59 120,38 160,25 200,21 240,16 280,12 320,10 360,9 400,7 graphdata<-read.csv('~/tmp/data.csv') graphmodeld<-lm(log(graphdata[,2])~graphdata[,1]) graphmodelp<-exp(predict(graphmodeld)) plot(graphdata[,2]~graphdata[,1]) lines(graphdata[,1],graphmodelp) Please