Hi list:

This is my first time to post my question on the list.  Thanks for your
help.

I am solving a quadratic programming using R. Here is my question:

w = arg min 0.5*w'Mw - w'N
s. t. sum(w) = 1;
       w>0

note: w is weight vector, each w_i must >=0, and the sum of w =1.

Here is my R code:

A <-matrix(c(2.26,1.26,1.12,1.12,2.27,1.13,1.12,1.13,2.2),3,3);
B <- c(0.007459281,0.007448885,0.007447850);
M <-nrow(A);
Amat <- cbind(rep(1,M), diag(M));
    bvec <- c(1,rep(0,M)) ;
    meq <- 1;

    min <- solve.QP(Dmat=A,dvec=B,Amat=Amat,bvec=bvec,meq=meq)

    init_prior.weig <-min$solution;

    cat("weight = ",init_prior.weig,"\n" )



My question is:   When I tried "big" matrix A and B, I get some negative
weights. I think I already put the constraints(w>0).  I want all weights >
0;

 Do I put the right constraints ?

Could you help figure out it. Thanks in advance.

Jiting

	[[alternative HTML version deleted]]

