Displaying 1 result from an estimated 1 matches for "d1_all".
Did you mean:
1_all
2011 Sep 23
1
Adding weights to optim
I realize this may be more of a math question. I have the following optim:
optim(c(0.0,1.0),logis.op,x=d1_all$SOA,y=as.numeric(md1[,i]))
which uses the following function:
logis.op <- function(p,x,y) {
ypred <- 1.0 / (1.0 + exp((p[1] - x) / p[2]));
res <- sum((y-ypred)^2)
return(res)
}
I would like to add weights to the optim. Do I have to alter the logis.op
function by adding an addi...