How to select k elements from two vectors of length n > k that maximize the correlation between the two vectors?

2 次查看(过去 30 天)
Hello everyone,
I have two numerical column vectors of length n, say vector A and vector B.
Consider a third column vector C which has k < n values equal to one, and zero otherwise.
I want C such that (A.*C)'*(B.*C) is maximized.
In other words, I need to decide which rows of A and B needs to remain (k of them needs to remain, n-k needs to me removed) to maximize the correlation between the vectors A and B. (In this sense, C can also be logical, 1 if row is in, zero if row is out)
Can you please help me to implement this maximization?
Many thanks for your help,
Marco
  3 个评论
Marco Brianti
Marco Brianti 2021-11-11
Dear John,
thanks for your reply. It is about the correlation. My point is that (A.*C)'*(B.*C) is somehow proportional to corr(A.*C,B.*C). Note that bewteen (A.*C)' and (B.*C) there is no dot-produc but only product. I am transposing the first vector such that the outcome is a scalar.
Does it make sense?
Many thanks,
Marco

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Quadratic Programming and Cone Programming 的更多信息

产品


版本

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by