I've tried the approach described in my second message and I always get the denominator equal to 1. Is this wrong?
Main Topics
Browse All TopicsHello,
I have a formula for intra-portfolio correlation but I think that it would be much easier to compute using matrices. Can someone show me please, how can I compute Q using the intraportfolio correlation formula using matrices? (the formula can be found at: http://en.wikipedia.org/wi
I thought that I would have two vectors: I containing Xi values, J containing Xj and a matrix P containing the correlation coefficients.
So, how can I coupute Q using the I,J vectors and P matrix?
Thanks,
M
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hi,
Being X[1... n] the array with the fraction invested in each asset, from a set o n asstes (obviously sum[x1 ... Xn] = 1), the correlation P is given by the following equation:
P = 2 * (xi / (xi + xj)) - 1
Then, the algorithm for calculating Q is:
--------------------------
calculateP(Xi, Xj)
{
P = Xi / (Xi + Xj)
return 2*P - 1
}
--------------------------
calculateQ(n, X[])
{
Q1=0, Q2=0
for (i=1, n)
for (j =1, n)
{
xij = X[i] * X[j]
Q1 += xij * P(X[i], X[j]);
Q2 += xij;
}
return "Q = " Q1/Q2;
}
Jose
Business Accounts
Answer for Membership
by: mircea_aPosted on 2007-07-01 at 15:56:00ID: 19400383
Correction (and I think I've got it, is this right???): :)
I think that probably I should put all the weights in a signle vector W....
So I think that the numerator would be euqal to something like:
W^T x P x W
and denominator equal to W^T x W
(Where W^T is W transposed)