[R] Maximization under constraits

From: Daniela Garavaglia <danygaravaglia84_at_virgilio.it>
Date: Fri, 25 Jul 2008 15:07:40 +0200


I'm looking for a R function which can maximise this logliklihood function, under the constraits a>0 e b>0  

f<-function(param){

  a<-param[1]

  b <-param[2]

log(prod)-(a*s2)-(b*s)-n*log(1-((0.5*b/sqrt(a))*(exp((b^2)/(4*a)))*((sqrt(pi ))*(1-pnorm(-b/(2*sqrt(a)), mean=0, sd=1)))))}  

I've tried maxlik constrOptim e donlp2 but without success.  

Thanks so much!!!    

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri 25 Jul 2008 - 15:25:47 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 28 Jul 2008 - 00:33:04 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive