Re: [R] Problem with constrained optimization with maxBFGS

From: peter dalgaard <pdalgd_at_gmail.com>
Date: Fri, 13 May 2011 09:07:41 +0200

On May 13, 2011, at 00:15 , Prof. John C Nash wrote:

> Is this a homework problem in finding the largest eigensolution of W? >

Not as stated. It said "sum D = 1", not "sum D^2 =1". With a linear constraint, it looks like weighted least squares, but then you should be minimizing, not maximizing. As stated, I'd say that the objective is unbounded, so something is amiss...

> If not, I'd be trying to maximize (D' W D)/ (D' D)
> 
> using (n-1) values of D and setting one value to 1 -- hopefully a value that is not going
> to be zero.
> 
> JN
> 
> 

>>
>> Date: Wed, 11 May 2011 17:28:54 -0300
>> From: Leonardo Monasterio <leonardo.monasterio_at_gmail.com>
>> To: r-help_at_r-project.org
>> Subject: [R] Problem with constrained optimization with maxBFGS
>> Message-ID: <BANLkTimJ0quyHgPA2ycMzO4ZPkhgPomNbw@mail.gmail.com>
>> Content-Type: text/plain
>>
>> Dear all,
>>
>> I need to maximize the v:
>>
>> v= D' W D
>>
>>
>> D is a column vector ( n , 1)
>> W is a given matrix (n, n)
>>
>> subject to:
>> sum D= 1
>>
>> (BTW, n is less than 300)
>> Ive tried to use maxBFGS, as follows:
>>
>> #####################################
>> objectiveFunction<-function(x)
>> {
>> return(t(D)%*%W%*%D)
>> }
>>
>> Amat<-diag(nrow(D))
>> Amat<-rbind((rep(-1, nrow(D))), Amat)
>> bvec<-matrix( c(0), nrow(D)+1, 1)
>> bvec[1,1]<-c(1)
>> startValues=rep(1/nrow(D),nrow(D)) #Istart value is homogeneous distribution
>> res <<- maxBFGS(objectiveFunction, start=startValues,
>> constraints=list(ineqA=Amat, ineqB=bvec))
>> ########################################
>> The outcome is equal to the startValues. Ive tried several initial values
>> and nothing changes.
>> Please, what am I doing wrong? Any suggestion?
>>
>> Thanks a lot!
>>
>> Leo.
>>
>> [[alternative HTML version deleted]]
>>
>>
>>
>> -
> 
> ______________________________________________
> R-help_at_r-project.org 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.

-- 
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes_at_cbs.dk  Priv: PDalgd_at_gmail.com

______________________________________________
R-help_at_r-project.org 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.
Received on Fri 13 May 2011 - 07:11:24 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 13 May 2011 - 08:10:07 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive