Message Boards Message Boards

0
|
2471 Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Append value to coordinates based on correlation

Posted 9 years ago

Hi,

I am working on a project that involves appending a z (in terms of z-axis) value to each coordinate based on the coordinate's respective list's correlation with other lists. I have tried finding sources on how to do the following but have not found anything that seems practical and would really appreciate help on the matter. I have included four random lists (labeled a,b,c and d) of financial data (of equal length) in the attached file. I would like to be able to automatically calculate the correlation of each list with every other list. I've calculated the correlations below but in reality I'll be working with many more lists so the correlation with each other list will need to automatically be performed. I imagine Permutations should be used in some way but I cannot think of how to effectively implement it. The correlations are as follow:

Correlation[a[[All,2]],b[[All,2]]]=0.31326

Correlation[a[[All,2]],c[[All,2]]]=0.467142

Correlation[a[[All,2]],d[[All,2]]]=0.245102

Correlation[b[[All,2]],c[[All,2]]]=0.307395

Correlation[b[[All,2]],d[[All,2]]]=0.24279

Correlation[c[[All,2]],d[[All,2]]]=0.1743

Based on the correlation each list has with another, I would like to add a z value to each coordinate. For example, as lists a and c have the highest correlation, and as List a, on average has a higher correlation with other lists, I would assign each coordinate in List a to have a z coordinate of 0 (lists a and c should remain closest together throughout the process, as they are most highly correlated). This process will continue until all lists have z coordinates appended to each coordinate set that results in each list being closest to another list that it is highly correlated, as well as making sure that no lists or sets of lists are close together when they have a low correlation.

I understand how to perform each function that I described manually, however I will be working with large sets of data, making the manual calculation of each step very impractical. Thank you in advance for any advice you may have on how to accomplish this, and feel free to tell me if I posted this in the incorrect Group or if I should clarify anything. Have a good day!

Sincerely,

Alejandro Braun

Attachments:
POSTED BY: Alejandro Braun
3 Replies

Sander,

Thank you for the prompt reply! As for the last paragraph, my end goal is to create a three dimensional representation of the data, such as a sheet, where, for example all of list a's values would have something to the effect of {x,y,1} and c's values would have {x,y,2}. The lists would have z coordinates that place highly correlated lists closer to each other (along the z axis) and lists that are less or not correlated would not be near each other on the z axis. Let me know if this helps.

Sincerely, Alejandro Braun

POSTED BY: Alejandro Braun

if you have n of these timeseries, you will get n(n-1)/2 number of correlation factors, how do you want all these to be assigned (as z values) to n timeseries??

POSTED BY: Sander Huisman

You could calculate the correlations in one 'swoop' like this (where a,b,c,d are your variables of any length):

Correlation @@@ Subsets[{a, b, c, d}[[All, All, 2]], {2}]

I'm not really sure what you want to do then with those values, I don't understand your last paragraphs really...

POSTED BY: Sander Huisman
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract