Clear Filters
Clear Filters

How to calculate this formula?

1 view (last 30 days)
fede
fede on 5 Nov 2015
Answered: Star Strider on 5 Nov 2015
I have a vector of weight w(1,n) and a vector of correlation p(n,1). How can calculate this formula?
  1 Comment
fede
fede on 5 Nov 2015
Sorry, I have the matrix of correlation, and not a vector.

Sign in to comment.

Accepted Answer

Star Strider
Star Strider on 5 Nov 2015
See if this works:
wij = triu(bsxfun(@times, w, w'));
num = wij*p;
den = sum(wij(:));
pr = sum(num(:))/den);

More Answers (0)

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!