[R] maximization help :
mingan yang
mingan at unm.edu
Tue May 3 05:16:28 CEST 2005
Given a vector : pvec=(p1,p2,.... p J) with sum(pvec)=1, all the
elements are non-negative, that is, they are probabilities
a matrix A ( N* J ), with the elements alpha(ij) are 0 or 1
I want to MAXIMIZE THE RESULT
RESULT= product( i=1, to N [ sum ( alpha(ij)* pj , j =1,to J
) ] )
thus, I need to get pvec. how should I do ?
for example
say, A= 0 1 0 0
1 1 0 0
1 0 0 0
0 0 1 0
1 0 0 1
0 0 0 1
that is A is a matrix 6* 4 thus pvec=(p1,p2,p3,p4)
I want to get values of pvec such that , they can maximize
p2 * ( p1 + p2 ) * p1 * p3 * (p1+p4) * p4
thanks
More information about the R-help
mailing list