[R] double exponential regression R

Joshua Wiley jwiley.psych at gmail.com
Sun Apr 21 22:09:53 CEST 2013


Hi CR,

Assuming your data are stored in "d", perhaps something like this:

m <- nls(log(proc) ~ k + a*(b^cls), start = list(a = 2, b = .25, k =
0), data = d)
summary(m)
# gives
## Formula: log(proc) ~ k + a * (b^cls)
## Parameters:
##   Estimate Std. Error t value Pr(>|t|)
## a  5.24617    0.50905  10.306 1.90e-09 ***
## b  0.69640    0.07718   9.023 1.73e-08 ***
## k  1.93055    0.42331   4.561  0.00019 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Residual standard error: 0.6967 on 20 degrees of freedom
## Number of iterations to convergence: 8
## Achieved convergence tolerance: 4.268e-06

and you can examine the fit:

plot(fitted(m), log(d$proc))

which looks not too bad (see attached)

Cheers,

Joshua


On Sun, Apr 21, 2013 at 12:34 PM, catalin roibu <catalinroibu at gmail.com> wrote:
> Hello all!
> I have a problem with a double exponential equation.
> This are my data's> structure(list(proc = c(1870.52067384719,
> 766.789388745793, 358.701545859122,  237.113777545511, 43.2726259059654,
> 148.985133316262, 92.6242882655781,  88.4521557193262, 56.6404686159112,
> 27.0374477259404, 34.3347291080268,  18.3226992991316, 15.2196612445747,
> 5.31600719692165, 16.7015717397302,  16.3923389973684, 24.2702542054496,
> 21.247247993673, 18.3070717608672,  2.8811892177331, 3.18018869564679,
> 8.74204132937479, 7.11596966047229 ), cls = c(0.25, 0.5, 0.75, 1, 1, 1.5,
> 2, 2.5, 3, 3.5, 4, 4.5,  5, 5.5, 6, 6.5, 7, 7.5, 8, 8.5, 9, 9.5, 10)),
> .Names = c("proc",  "cls"), row.names = c("0.25", "0.5", "0.75", "1", "11",
> "1.5",  "2", "2.5", "3", "3.5", "4", "4.5", "5", "5.5", "6", "6.5", "7",
>  "7.5", "8", "8.5", "9", "9.5", "10"), class = "data.frame")
> I want to compute a double exponential equation like this:
> proc=a*exp(b*class)+c*exp(d*class)
>
> Thank you very much for your help!
>
> Best regards!
>
> CR
> --
> ---
> Catalin-Constantin ROIBU
> Lecturer PhD, Forestry engineer
> Forestry Faculty of Suceava
> Str. Universitatii no. 13, Suceava, 720229, Romania
> office phone     +4 0230 52 29 78, ext. 531
> mobile phone   +4 0745 53 18 01
>                        +4 0766 71 76 58
> FAX:                +4 0230 52 16 64
> silvic.usv.ro
>
>         [[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.



-- 
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://joshuawiley.com/
Senior Analyst - Elkhart Group Ltd.
http://elkhartgroup.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fit.png
Type: image/png
Size: 5534 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130421/62979957/attachment.png>


More information about the R-help mailing list