[R] France Model

Sven Garbade sven.garbade at evall.org
Sat May 5 12:42:27 CEST 2012


Given your starting values, there is nothing to optimize:

> f <- function(x, A=10, b=152, T=100, c=100) A*(1-exp(-b*(x-T) -
c*(sqrt(x) - sqrt(T))))
> f(time)
 [1] -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf
-Inf -Inf
[16] -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf
-Inf -Inf
[31] -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf
-Inf -Inf
[46] -Inf -Inf -Inf

same with A = 500

So try to find a better model, or more sensible starting values.

Regards, Sven


On 05/04/2012 03:41 PM, Silvano wrote:
> Hi,
>
> I need fit the France model :
>
> y = A{1 - exp[-b(t-T) - c(sqrt(t) - sqrt(T))]}
>
> parameters: A, b, T, c
> variable: t (time)
> resp: y
>
>
> I tried:
> time = 1:48
> resp = rnorm(48, 200, 10)
>
> dados = data.frame(resp, time)
> attach(dados)
>
> f = function(x, A, b, T, c)
>  A*(1-exp(-b*(x-T) - c*(sqrt(x) - sqrt(T))))
>
> (mod1 = nls(resp~f(time, A, b, c, T), data=dados,
>           start=c(A=500, b=152, c=100, T=100)))
>
> but isn't work. The error is:
>
>> (mod1 = nls(resp~f(tempo,A,b,c,T), data=dados,
> +            start=c(A=10, b=152, c=10, T=10)))
> Erro em numericDeriv(form[[3L]], names(ind), env) :
>  Obtido valor faltante ou infinito quando avaliando o modelo
>
> Somebody knows some package?
>
> Thanks,
>



More information about the R-help mailing list