[R] Equation constraints: optim()

About this list Date view Thread view Subject view Author view Attachment view

From: WARR Benjamin (benjamin.warr@insead.fr)
Date: Tue 17 Jul 2001 - 18:56:39 EST


Message-id: <C374E6A0E25BD41197FB00508B014A1302874983@FW-ZEUS>

Dear All,

I am using optim() to minimise a function,

(y-E exp{a*(2-(L+E/K))+ a * c (L/E -1))^2

I would like the result to respect the following constraints. The problem I
am having problems understanding is how to impose them, when they relate not
to the parameters a and c directly, but to equations containing a and c,

alpha = a * (L+E/K)
beta = a * (c * L/E + L/K)
gamma = 1 - alpha - beta

where

alpha, beta and gamma are all non-negative and sum to 1. Gamma itself does
not appear in the function to be fitted.

I note that within Mathematic it is possible to solve under constraints on
the parameters and equations containing the parameters ? Is this possible in
R ?

Does anyone have any ideas ? Am I missing an obvious mathematical solution
and thereby asking too much of r ?

many thanks

Ben Warr


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Wed 10 Mar 2004 - 08:18:20 EST