Proponha solução(ções) para o seguinte post:
I would like to get parameter estimates for different models. For one of them I give the code in example. I am estimating the parameters (i,j and k) with the nls function, which sees the error distribution as normal, I would however like to do the same as nls with the assumption that the errors are poisson distributed.
Is there a way to do this with R? Are there packages designed for this? I tried with the gnm package, but don't understand how to transform my equation to a generalised equation. Is there an option for nls to choose family = poisson?
Lower in the mail the code with the model and visualisations I use to check my results. I also copied the test dataset from my txt file.
plot(FR~N0) x <- nls(FR~(exp(i+j*N0)/(1+exp(i+j*N0)))*(k*N0/(k+N0)),start=list(i=0.02,j=0.002,k=6)) summary(x) hatx <- predict(x) lines(spline(N0,hatx)) N0 FR 10 2 10 3 10 2 10 4 10 2 10 2 10 1 10 2 10 2 10 2 20 2 20 3 20 3 20 3 20 4 20 2 20 4 20 2 20 3 20 2 30 1 30 2 30 3 30 4 30 5 30 6 30 2 30 3 30 2 30 2 40 2 40 3 40 3 40 6 40 5 40 4 40 3 40 3 40 2 40 3 50 4 50 5 50 2 50 3 50 7 50 5 50 4 50 3 50 4 50 5 60 5 60 6 60 8 60 4 60 4 60 3 60 2 60 2 60 5 60 4