[R] Lower bounds on selfStart function not working

Schatzi adele_thompson at cargill.com
Mon Nov 7 20:16:26 CET 2011


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]
   b.s    <- value[4]
  y1<-rep(0,length(xy$x)) # generate vector for predicted y (y1) to evaluate
against observed y
  for(cnt in 1:length(xy$x)){
  y1[cnt]<- b.s+A.s/(1+exp(4*mu.s/A.s*(l.s-xy$x[cnt])+2))}  #predicting y1
for values of y
  evl<-sum((xy$y-y1)^2) #sum of squares is function to minimize
  return(evl)}


There is another place where there is an "x" in the selfStart function:
SSpowrDplt<-selfStart(~b+A/(1+exp(4*mu/A*(l-x)+2)),initial=powrDpltInit,
parameters=c("A","mu","l","b"))

I don't know why that is working fine or how it knows that my "x" is that
specific one. It seems that I am not fully understanding how this is
working.

-----
In theory, practice and theory are the same. In practice, they are not - Albert Einstein
--
View this message in context: http://r.789695.n4.nabble.com/Lower-bounds-on-selfStart-function-not-working-tp3999231p4012805.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list