[R] How can I fitting this function from values.

Joerg van den Hoff j.van_den_hoff at fzd.de
Mon Nov 12 21:06:42 CET 2007


On Mon, Nov 12, 2007 at 04:27:26PM -0300, Horacio Castellini wrote:
> Hi all, I'd like fit this function:
> 
> G(t)=A*1/(1+t/B)*1/sqrt(1+t/C)
> 
> where A, B and C are fitting constants that one like search. I have
> got a fcs<-(t,G(t)) value table in a data frame.
> 
> Any one can help me? Tahnks Horacio.

if your data are in `df' and the columns are labeled `t' and `G'
this seems what you want (cf. `?nls'):

nls(G ~ A*1/(1+t/B)*1/sqrt(1+t/C), start =list(A=1, B=2, C=3), data = df) 

where `start' should be set to reasonable start values.

and I would think, it is better to use p1 = 1/B, p2= 1/C during the fit
(no singularities of G for certain parameter values...).

joerg



More information about the R-help mailing list