I have two time series A, B. Both are seasonal and B primarily is A driven( other temporal causes may exist).
B-Red, A- Green
I want to calculate lag of red series with respect to green as clearly, it exists.
Now, I am taking Spearman's correlation at different lags and choosing the max to decide the lag which gives satisfying answer.
To confirm the confidence in lag, I am trying entropy based methods.
I tried conditional entropy and here are the results.
lag C-Entropy corr
0 1.0820745 -0.735406343
1 0.8978593 -0.830377446
2 1.1218689 -0.689623230
3 1.2412857 -0.336204576
4 1.2985196 0.054672496
5 1.2727747 0.485228731
6 1.1027205 0.771465042
7 0.9616463 0.839862100
8 1.1296509 0.677166842
9 1.2805970 0.396034333
10 1.3420290 0.005832166
I am confused over this.
1 0.8978593 -0.830377446
Correlation is highly negative while entropy is down?
R code for entropy calculation:
B_d= discretize(B)
A_d= discretize( A)
H <- condentropy(B_d, A_d, method = "mm")
Also, Any suggestions for entropy based methods or options which can be helpful for this situation. I have to find lags over several such pairs and need another metric to evaluate lag calculated from correlation.