# Different Correlation Coefficents with different Time Ranges

I built a Time-Series that displays the price of the Electricty Price in South Italy and two of their most important commodities (commodities, gas) used to produce the eletrical energy. So I ordered all these data into DataFrame where there are the following data in details:

1. First Column - Daily Price of Petroil Future during N Day;
2. Second Column - Daily Price of Gas Future during N Day;
3. Third Column - Daily Price of Dau-Ahead Eletricity Market in Italy;

The data are taken from 2010 to 2022 time range, so 12 years of historical time data. The DataFrame head looks like this:

     PETROIL       GAS  ELECTRICITY
0  64.138395  2.496172    68.608696
1  65.196161  2.482612   113.739130
2  64.982403  2.505938   112.086957
3  64.272606  2.500000   110.043478
4  65.993436  2.521739    95.260870


So on this DataFrame I tried to build the Correlation Matrix throught the Pandas metod .corr() (using the Pearson method) and faced one big issue:

If I take all 12 years as data I get:

1. almost Zero as correlation between Electricity and Petroil price;
2. low correlation (0.12) between Electricity and Gas price;

If I try to split in three time range (2010-2014; 2014-2018; 2018-2022) I get for each interval, really high correlation for both pair (electricity-gas, electricity-petroil) in a range around 0.60 to 0.90.

So I am here asking these two questions:

1. Why I get this so high difference when I split the time ranges?
2. Considering I am doing this kind of analysis to use Petroil and Gas prices to predict the electricity price, which of these two analysis should I consider? The first one (with low correlation) that considers the entire time range or the second one (with higher correlation) that is split into different time ranges?

This might be explained by the nature of your data in different market circumstances in the different timeframes, to elaborate, these are each market circumstances with a high correlation between prices of commodity A and B:

• A declines <-> B increases (strong negative correlation)
• A increases <-> B decreases (strong negative correlation)
• A increases <-> B increases (strong positive correlation)
• A decreases <-> B decreases (strong positive correlation)
In other timeframes, prices between commodity A and B can decouple. The correlation is thus 0:
• sometimes A increases when B decreases and sometimes the other way around (correlation is still 0 because values single out each other)