[R] equality constraint

2006-07-22 Thread anamaria
I would like to optimize a (log-)likelihood function subject to
linear equality constraints in parameters. My function has eight
parameters. The first one, third and fourth are greater than zero, the
second one must be less than zero. The problem is that the last four must
sum zero. Function constrOptim only fits inequality constraints.
Is there an alternative to lead with this problem?

Ana Maria

__
R-help@stat.math.ethz.ch 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.


Re: [R] equality constraint

2006-07-22 Thread Simon Wood
 I would like to optimize a (log-)likelihood function subject to
 linear equality constraints in parameters. My function has eight
 parameters. The first one, third and fourth are greater than zero, the
 second one must be less than zero. The problem is that the last four must
 sum zero. Function constrOptim only fits inequality constraints.
 Is there an alternative to lead with this problem?

- Any reason not to just replace e.g. parameter 8 with minus the sum of 
parameters 5, 6, and 7?

best,
Simon

- Simon Wood, Mathematical Sciences, University of Bath, Bath BA2 7AY 
- +44 (0)1225 386603 www.maths.bath.ac.uk/~sw283/

__
R-help@stat.math.ethz.ch 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.


Re: [R] equality constraint

2006-07-22 Thread John Fox
Dear Ana Maria,

How about replacing the last of the four parameters with the negative of the
sum of the others?

I hope this helps,
 John


John Fox
Department of Sociology
McMaster University
Hamilton, Ontario
Canada L8S 4M4
905-525-9140x23604
http://socserv.mcmaster.ca/jfox 
 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
 Sent: Friday, July 21, 2006 4:31 PM
 To: r-help@stat.math.ethz.ch
 Subject: [R] equality constraint
 
 I would like to optimize a (log-)likelihood function subject 
 to linear equality constraints in parameters. My function has 
 eight parameters. The first one, third and fourth are greater 
 than zero, the second one must be less than zero. The problem 
 is that the last four must sum zero. Function constrOptim 
 only fits inequality constraints.
 Is there an alternative to lead with this problem?
 
 Ana Maria
 
 __
 R-help@stat.math.ethz.ch 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.


__
R-help@stat.math.ethz.ch 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.