I was able to solve this problem by going back to nls and obtaining the
initial parameter estimates through optim. When I used nlsList with my
dataset, it took 2 minutes to solve and was not limited by the bounds. Now I
have the bounds working and it takes 45 seconds to solve. Here is the new
code:
I ran the code again and got an error saying that the "x" was unknown. I
don't know why I hadn't seen that error before. Anyway, I made the edits to
"func1" so instead of "x", it is "xy$x."
#function to optimize
func1 <- function(value) {
A.s <- value[1]
mu.s <- value[2]
l.s <- value[3]
I tested the "optim" function and that is returning non-negative parameter
values (meaning they are bound by the lower limits), but I think those are
the starting estimates for the nlsList model which is then finding negative
values for the solution.
-
In theory, practice and theory are the sa
I adapted a selfStart function and the lower bounds are not working. The
parameter "b" is negative, whereas I would like the lower bound to be zero.
Any ideas? Thanks.
Here is my code (I am still figuring out how to easily make replicable
examples):
A<-1.75
mu<-.2
l<-2
b<-0
x<-seq(0,18,.25)
create
4 matches
Mail list logo