I have been trying to fit non linear quantile regression model with nlrq()
(from quantreg
package). But what I found that the function is very sensitive to starting values. So I tried to use self starter SSexp()
with it. What I read that self starter functions made for nls()
also works with it. But all the time I am getting the following error message :
"Error in getInitial(formula, mf) : unused argument (mf)"
my input code was:
fit12 <- nlrq(visit.rate ~ SSexp(het.total, y0, b),
data = flower_mat,tau = 0.75)
I have kind of vague idea that getInitial
is somehow connected to create self starter function. But frankly speaking I have no idea where exactly the problem is. Can anybody help me regarding this?
Additional Information
# R version 3.1.2 -- "Pumpkin Helmet"
# quantreg version: 5.05
# nlrwr version : 1.1-0
# toy dataset and code
x <- c(0.3,0.6,0.9,1,1.5,2, 2.1, 2.5,3, 3,5,10,11,12,14,13,17,21,23,27,30, 50)
y <- c(0,0.1,0.3,0.4,0.6,0.2,0.27,0.2,0.25,0.4,0.15,0.05,0.25,0.2,0.3,0.35,0.1,0.15,0.1,0.14,0,0)
dat <- data.frame(x,y,stringsAsFactors=FALSE)
plot(y~x)
library(quantreg)
library(nlrwr)
fit.1 <- nlrq(y ~ SSexp(x, y0, b),
data = dat,tau = 0.75)
# above mentioned error message
with(dat, SSexp(x, 0.2, 4))
# this is working
getInitial((y ~ SSexp(x, y0, b)), dat)
# showing following error:
# Error in getInitial((y ~ SSexp(x, y0, b)), data = dat) : unused argument (dat)