Skip to content
Back to formatted view

Raw Message

Message-ID: <1337275158924-4630419.post@n4.nabble.com>
Date: 2012-05-17T17:19:18Z
From: Pacin Al
Subject: Optimization problem
In-Reply-To: <CAFEqCdxCYPto3A6fWCabz=qBBKp7yuUkgtay1ELriyiKU9bDyQ@mail.gmail.com>

Hi Greg,


The problem is that I also have restrictions for each variable (they must be
higher than -.07 and smaller than .2) and I'm dealing with a lot of them.

I've already tried the second approach but, as far as it seems, the function
doesn't satisfy my objective.  
That's what I'm doing:

.....................
faum = function(aum)
{
(...)
ifelse(colMeans(prob) >.65, totm <- (sum(marg)), totm <- -1e10) 
#prob is a transformation of 'aum' and sum(marg) (always positive) is what I
want to maximize
(...)
return(-totm)
}

optim(rep(0,nrow), faum, method="L-BFGS-B", control=list(trace=12),
lower=rep(-.07,nrow), upper=rep(.2,nrow) )
.....................

The function gives me 1e10 if my initial values for the parameters doesn't
satisfy mean>.65 and doesn't improve my initial conditions if they satisfy
mean<=.65.

I know that a solution with mean>.65 exists, I can find it by hand.

 

--
View this message in context: http://r.789695.n4.nabble.com/Optimization-problem-tp4630278p4630419.html
Sent from the R help mailing list archive at Nabble.com.