I read about using the log as an alternative for creating a linear equation so that I can extract starting values for an nls fit from the linear equation, in R; Accordingly,
For equation: Y=q/(1+bDX)^(1/b) where Y and X are my data; q,b,D are my parameters to be estimated. I created the linear model:
X<-1:45
Y <- c(35326L, 30339L, 23379L, 21877L, 18629L, 17627L, 15691L, 15435L,
14205L, 11732L, 10560L, 10592L, 9939L, 7491L, 4928L, 3427L, 8123L,
9027L, 8733L, 9599L, 8737L, 9135L, 8548L, 7279L, 8940L, 8459L,
8460L, 7700L, 6817L, 7167L, 7089L, 7091L, 7538L, 9206L, 9680L,
5876L, 7799L, 8384L, 10586L, 8623L, 7848L, 5534L, 6610L, 6539L,
6650L)
lmodel <- coef(lm(log(Y)~X+I(X^2)))
q0 <- exp(lmodel[1])
D0 <- -lmodel[2]
b0 <- lmodel[3]*2/D0^2
Start1=list(q=q0,b=b0,D=D0)
theta_hat2 <- nls(y~q*(1+b*D*x)^(-1/b),start=Start1)
This provides me the required results everytime. However, I want to fit nls to some other equations mentioned below which are rather difficult for me. If someone can help me make a linear model to fit these, I would greatly appreciate.
Equation 2:
Y=q*(-D+(b/n)*X^n here q,b,D,n are to be estimated.
Equation 3:
Y=q*exp(-(X/D)^b here q,b,D are to be estimated.
Equation 4:
Y=q*X^((-b) )*exp(D/((1-b) )*(X^(1-b)-1) here q,b,D are to be estimated.
I am attaching example dataset for this problem here: