Skip to content
Back to formatted view

Raw Message

Message-ID: <20051128152226.9786.qmail@web26801.mail.ukl.yahoo.com>
Date: 2005-11-28T15:22:25Z
From: Florent Bresson
Subject: optimization with inequalities

I have to estimate the following model for several
group of observations :

 y(1-y) = p[1]*(x^2-y) + p[2]*y*(x-1) + p[3]*(x-y)

with constraints :
 p[1]+p[3] >= 1
 p[1]+p[2]+p[3]+1 >= 0
 p[3] >= 0

I use the following code :
 func <- sum((y(1-y) - p[1]*(x^2-y) + p[2]*y*(x-1) +
p[3]*(x-y))^2)
 estim <- optim( c(1,0,0),func, method="L-BFGS-B" ,
lower=c(1-p[3], -p[1]-p[3]-1, 0) )

and for some group of observations, I observe that the
estimated parameters don't respect the constraints,
espacially the first. Where's the problem please ?