exponential day

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

exponential day

Francis Boateng
Hi,
Please, how can I determine parameters from exponential equation
Example one:  y = a*exp(-b*x);  how do I determine �a� and �b�, as well as R-square from data sets. And also fitting y = a*exp(-b*x) into the data sets
Assuming data sets
A = (0,2,4,6,8,10)
B = (1,0.8,0.6,0.4,0.2,0.1)

Thanks
Francis


Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10


        [[alternative HTML version deleted]]


______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: exponential day

S Ellison-2
> Please, how can I determine parameters from exponential equation Example
> one:  y = a*exp(-b*x);  how do I determine  a  and  b , as well as R-square
> from data sets. And also fitting y = a*exp(-b*x) into the data sets Assuming
> data sets A = (0,2,4,6,8,10) B = (1,0.8,0.6,0.4,0.2,0.1)

For least squares fitting, you could take logs and do a simple linear fit, if the resduals are reasonably homoscedastic in the log domain (or if you can sort the weighting out properly).

For non-linear least squares, look at ?nlm, ?nls or (if you want to roll your own) ?optim

For max likelihood, maybe nlme in the nlme package.

For other ideas, look up 'non-linear fitting with R' on any search engine, or check the R Task Views

S Ellison



*******************************************************************
This email and any attachments are confidential. Any use, copying or
disclosure other than by the intended recipient is unauthorised. If
you have received this message in error, please notify the sender
immediately via +44(0)20 8943 7000 or notify [hidden email]
and delete this message and any copies from your computer and network.
LGC Limited. Registered in England 2991879.
Registered office: Queens Road, Teddington, Middlesex, TW11 0LY, UK
______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: exponential day

Francis Boateng
Thanks Ellison, I will try it.

Francis


-----Original Message-----
From: S Ellison <[hidden email]>
Sent: Thursday, August 9, 2018 8:12 AM
To: Francis Boateng <[hidden email]>; [hidden email]
Subject: RE: exponential day

> Please, how can I determine parameters from exponential equation
> Example
> one:  y = a*exp(-b*x);  how do I determine  a  and  b , as well as
> R-square from data sets. And also fitting y = a*exp(-b*x) into the
> data sets Assuming data sets A = (0,2,4,6,8,10) B =
> (1,0.8,0.6,0.4,0.2,0.1)

For least squares fitting, you could take logs and do a simple linear fit, if the resduals are reasonably homoscedastic in the log domain (or if you can sort the weighting out properly).

For non-linear least squares, look at ?nlm, ?nls or (if you want to roll your own) ?optim

For max likelihood, maybe nlme in the nlme package.

For other ideas, look up 'non-linear fitting with R' on any search engine, or check the R Task Views

S Ellison



*******************************************************************
This email and any attachments are confidential. Any use, copying or disclosure other than by the intended recipient is unauthorised. If you have received this message in error, please notify the sender immediately via +44(0)20 8943 7000 or notify [hidden email] and delete this message and any copies from your computer and network.
LGC Limited. Registered in England 2991879.
Registered office: Queens Road, Teddington, Middlesex, TW11 0LY, UK
______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: exponential day

Bert Gunter-2
Please note that R^2 for nonlinear models is nonsense.

Search on "R^2 in nonlinear models" for details, e.g.

http://statisticsbyjim.com/regression/r-squared-invalid-nonlinear-regression/

Cheers,
Bert


Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Wed, Aug 15, 2018 at 10:54 AM Francis Boateng <
[hidden email]> wrote:

> Thanks Ellison, I will try it.
>
> Francis
>
>
> -----Original Message-----
> From: S Ellison <[hidden email]>
> Sent: Thursday, August 9, 2018 8:12 AM
> To: Francis Boateng <[hidden email]>;
> [hidden email]
> Subject: RE: exponential day
>
> > Please, how can I determine parameters from exponential equation
> > Example
> > one:  y = a*exp(-b*x);  how do I determine  a  and  b , as well as
> > R-square from data sets. And also fitting y = a*exp(-b*x) into the
> > data sets Assuming data sets A = (0,2,4,6,8,10) B =
> > (1,0.8,0.6,0.4,0.2,0.1)
>
> For least squares fitting, you could take logs and do a simple linear fit,
> if the resduals are reasonably homoscedastic in the log domain (or if you
> can sort the weighting out properly).
>
> For non-linear least squares, look at ?nlm, ?nls or (if you want to roll
> your own) ?optim
>
> For max likelihood, maybe nlme in the nlme package.
>
> For other ideas, look up 'non-linear fitting with R' on any search engine,
> or check the R Task Views
>
> S Ellison
>
>
>
> *******************************************************************
> This email and any attachments are confidential. Any u...{{dropped:18}}

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: exponential day

J C Nash
Since I'm associated with a lot of nonlinear modeling software, including nlsr and (now
deprecated) nlmrt, I'll perhaps seem an odd person to say that I calculate an R^2 quite
regularly for all sorts of models. I find it useful to know if my nonlinear models do
poorly compared to the model that is simply the mean of the data.

The big issue, of course, is to get across to people that all their linear model ideas
about this quantity -- and we need some other name here -- are indeed rubbish in this
context. All I'm doing is comparing two models in a very crude way. Useful? Sometimes,
esp. if the result is a negative number (i.e., a nonlinear model is less effective in
approximating data than a single value).  Is it important? No. We only want to avoid
using bad models, and this is a quick and dirty flag.

Best, JN


On 2018-08-15 02:04 PM, Bert Gunter wrote:

> Please note that R^2 for nonlinear models is nonsense.
>
> Search on "R^2 in nonlinear models" for details, e.g.
>
> http://statisticsbyjim.com/regression/r-squared-invalid-nonlinear-regression/
>
> Cheers,
> Bert
>
>
> Bert Gunter
>
> "The trouble with having an open mind is that people keep coming along and
> sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>
>
> On Wed, Aug 15, 2018 at 10:54 AM Francis Boateng <
> [hidden email]> wrote:
>
>> Thanks Ellison, I will try it.
>>
>> Francis
>>
>>
>> -----Original Message-----
>> From: S Ellison <[hidden email]>
>> Sent: Thursday, August 9, 2018 8:12 AM
>> To: Francis Boateng <[hidden email]>;
>> [hidden email]
>> Subject: RE: exponential day
>>
>>> Please, how can I determine parameters from exponential equation
>>> Example
>>> one:  y = a*exp(-b*x);  how do I determine  a  and  b , as well as
>>> R-square from data sets. And also fitting y = a*exp(-b*x) into the
>>> data sets Assuming data sets A = (0,2,4,6,8,10) B =
>>> (1,0.8,0.6,0.4,0.2,0.1)
>>
>> For least squares fitting, you could take logs and do a simple linear fit,
>> if the resduals are reasonably homoscedastic in the log domain (or if you
>> can sort the weighting out properly).
>>
>> For non-linear least squares, look at ?nlm, ?nls or (if you want to roll
>> your own) ?optim
>>
>> For max likelihood, maybe nlme in the nlme package.
>>
>> For other ideas, look up 'non-linear fitting with R' on any search engine,
>> or check the R Task Views
>>
>> S Ellison
>>
>>
>>
>> *******************************************************************
>> This email and any attachments are confidential. Any u...{{dropped:18}}
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> 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.
>

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.