[R] Non linear regression with complex equation
jeff_hawkes
j.hawkes at noc.soton.ac.uk
Tue Feb 28 11:05:24 CET 2012
Apologies for the phrasing of the question.
I've sorted the problem (thanks Bert Gunter) by using the curly brackets {}
as below (using a simplified version of my real model). I hope this helps
someone else!
Jeff
-----------------------
> data
Alpha ip X
1 0.7106967 0.3616727 0.006027879
2 2.1678517 5.0615917 0.084359861
3 4.4066250 11.2282945 0.187138242
4 9.8495694 18.0534974 0.300891624
5 27.7247098 29.2064434 0.486774057
6 70.6931430 35.3946092 0.589910153
7 133.1240255 46.0347288 0.767245480
8 214.7851844 49.3811149 0.823018582
9 359.5511036 58.5069583 0.975115972
10 748.1840127 57.3744477 0.956240795
11 2129.9844080 60.0000000 1.000000000
> c<-1.83e-9
> cFe=c
> model<-nls({Fe1<-cFe/(Alpha+1+k*c)
+ X~Alpha/(Alpha+1+k*c/(1+k*Fe1))},start=list(k=1e10))
> summary(model)
Formula: X ~ Alpha/(Alpha + 1 + k * c/(1 + k * Fe1))
Parameters:
Estimate Std. Error t value Pr(>|t|)
k 3.491e+10 7.190e+09 4.856 0.000665 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.05589 on 10 degrees of freedom
Number of iterations to convergence: 8
Achieved convergence tolerance: 2.393e-06
--
View this message in context: http://r.789695.n4.nabble.com/Non-linear-regression-with-complex-equation-tp4425942p4427617.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list