Correlate two data sets

I've two sets of data, which I would like to correlate. The number of elements in both the data sets are different and have different respective dates. What would be the best way to do this?

2 Comments

You can try to by considering all dates, in both data sets by color variation in the value of both datasets
I've a lot of different data sets and wanted to get a coefficient of correlation between each set. The above is just an example of the issue that I am facing.

Sign in to comment.

Answers (1)

jonas
jonas on 31 Jul 2018

0 votes

Obviously there is a linear increase over time in the longer vector. You can simply interpolate the values in the longer vector to match the exact dates of the shorter vector and then check the correlation by corr.

2 Comments

The actual data (which is a lot larger) is not very linear. Is there any other way you can propose.
jonas
jonas on 31 Jul 2018
Edited: jonas on 31 Jul 2018
From what I know, correlation is calculated pair-wise, so without somehow pairing the samples I don't know how you can calculate a correlation coefficient.
You may be interested in cross-correlation though ( link )

Sign in to comment.

Asked:

on 31 Jul 2018

Edited:

on 31 Jul 2018

Community Treasure Hunt

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

Start Hunting!