I am trying to estimate a complex model with nlsLM()
in R package minpack.lm
. It goes like this:
nlc <- nls.lm.control(maxiter = 10000, maxfev = 10000)
nlsLM(formula = log(demand+0.001) ~ Diff.model.log(m,pin,q,lambda1,lambda2,goal,length,time),
data = projects_long,
start = c(lambda1 = lambda1, lambda2 = lambda2, m = m, pin = pin, q = q),
upper = c(5,5,Inf,1,1), lower = c(-Inf,0,0,0,0),
algorithm = "port", control = nlc)
You can see I placed lower bounds 0
on four out of the five parameters that I was trying to estimate, and they seem to be binding indeed: all sets of parameters I got at the minimum did include zeros...
But in fact, in my applications the parameters being zero is not interpretable and I'd rather them strictly positive. I was wondering how could I specify in the code such that the bound is not reachable?
Thanks very much for any guidance here!