[R] Help in optimization

Ricardo Bessa
Wed, 11 Oct 2006 17:06:11 -0000

I have had a problem in finding the minimum of a function, the function in
cause is:

curv <- function(a,b){
date <-
read.table("bessa.csv",header=T,sep=";",dec=",")
calP <- (22000)/(1+exp(-(a*date$v+b)))
err <- (calP-date$P)^2
return(sum(err))
}

It would like to know which function that I must use to find the values of
?a? and ?b? that minimize the function curv. I Already tried with the
functions ?optim? and ?nlm?, but without success, perhaps I am not using
them correctly.

Ricardo Bessa

_________________________________________________________________
MSN Busca: f?cil, r?pido, direto ao ponto.  http://search.msn.com.br