nls

  1. L

    Non-linear model fit

    Hi everyone. I am working on fitting a non-linear least squares model with R. My data points are virus contentration (ydata) over a timeline of 33 days (xdata). The decrease in virus concentration should be modeled with the following function: log(c/c0) = (-lambda0/alpha)*(exp(-alpha*time)-1)...
  2. P

    R: Weighted nls fit of multiple datasets with nested paramaters

    I have a number of datasets that I'd like to fit with a model of the form a*(x+b)^c where b, c are common to each dataset with only the amplitude changing. zz = read.table("zz.dat") x_zz<-zz[,1] y_zz<-zz[,2] xy_zz<-data.frame(x_zz,y_zz) err_zz<-zz[,3] A regular nls fit to a...
  3. H

    nls error says "singular gradient"

    I cannot get this code to work and I'm sure there is a very simple solution i<-seq(1,length(rhino[,2])-1) j<-seq(2,length(rhino[,2]),1) Increase=c((Population[j]-Population[i])/Population[i]) Years<-c(Year[j]-Year[i]) Years2<-c(0,Population[j]-1960) # Cumulative Years...
  4. M

    Likelihood ratio test on Nonlinear regression done manually. Possible or typo?

    Dear all, this forum is great! If I knew about it before, my studies would have been much more enjoyable. Anyways, right now I’m looking at past exams of my advanced econometrics course; I’ve been trying for two days now to solve this exercise, advanced text books at hand and constantly on...
  5. O

    Factors in an nls model

    Hello, I have some nls model fitted with a four parameter logistic curve. model<-nls(V1 ~ SSfpl(V2, a, b, c, e)) I want to test the effect of a factor on this fit, something like: model<-nls(V1 ~ SSfpl(V2+factor, a, b, c, e)) or model<-nls(V1 ~ SSfpl(V2, a, b, c, e)+factor)...