Where is the problem ? then you have to write the objective function with the restriced value before call optim()
Justin BEM BP 1917 Yaoundé Tél (237) 99597295 (237) 22040246 ________________________________ De : Luis SAGAON TEYSSIER <[EMAIL PROTECTED]> à : r-help@r-project.org Envoyé le : Jeudi, 30 Octobre 2008, 10h11mn 08s Objet : [R] how to restrict a parameter in optim() > Dear all, > > I'm trying to estimate some parameters with the optim() function but I > need to restrict one parameter and I have not found how to do it. Could > you help me please? > > my program is basically > > fn<-function(s) > > initial<-function(r) > { > cst<-r[1] > cst1<-r[2] > beta<-r[3] > rho<-r[4] > p1<-r[5] > > return(-sum()) > } > > parms<-c() > > m0<-optim() > > > I need to specify 0<=p1<=1. > > Thank you very much > > Luis SAGAON ______________________________________________ R-help@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. [[alternative HTML version deleted]]
______________________________________________ R-help@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.