Kristian Lind
2011-Sep-07 19:50 UTC
[R] Imposing Feller condition using project constraint in spg
Dear R-users, I'm running a maximization problem in which I want to impose a condition on the relationship between 2 parameters. The condition is that w[4] = (1+eps)/(2*w[1]), or equivalently w[4]*w[1] (1+eps)/2 , where eps is some small positive constant. I've been trying to formulate a function that takes care of this, but I can't really make it work so any suggestions would be much appreciated. Thank you. Kristian Lind [[alternative HTML version deleted]]
Ravi Varadhan
2011-Sep-08 14:00 UTC
[R] Imposing Feller condition using project constraint in spg
Hi Kristian, The idea behind projection is that you take an iterate that violates the constraints and project it onto a point such that it is the nearest point that satisfies the constraints. Suppose you have an iterate (w1, w4) that does not satisfy the constraint that w1 * w4 != (1 + eps)/2. Our goal is to find a (w1', w2'), given (w1, w2), such that (A) w1' * w2' = (1+eps)/2 = k (B) (w1-w1')^2 + (w2-w2')^2 is minimum. This is quite easy to solve. We know (w1, w2). You plug in w2' = k/w1' from (A) into (B) and minimize the function of w1'. This is a simple calculus exercise, and I will leave this as a homework problem for you to solve! Best, Ravi. ------------------------------------------------------- Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins University Ph. (410) 502-2619 email: rvaradhan@jhmi.edu<mailto:rvaradhan@jhmi.edu> [[alternative HTML version deleted]]