# Test for feature dependencies in time series modelling

I have time-series data that track event occurrence in 3 locations. Here's a sample:

               Count     Total
Location       A  B  C
Date
2018-06-22     0  1  1     2
2018-06-23     2  1  0     3
2018-06-24     0  0  1     1
2018-06-25     2  2  1     5
2018-06-26     0  3  1     4


I would like to use the data to predict the total number of event occurrences at a given date in the future. How do I test if an event happening in one location has an impact on events happening in another location (dependency)? I believe that if an event happening in locations B and C are dependant, I should sum the 2 columns together as 1 feature in my model.

## 1 Answer

How do I test if an event happening in one location has an impact on events happening in another location (dependency)?

• Pearson correlation between the two columns would already give you a simple indication of whether there is a dependency relation.
• A $$\chi$$-square test would tell you whether there is a significant difference between an observed variable (e.g. count in one location) and an expected variable (count in the other location). In other words, it can tell you whether the variables are independent or not.
• The conditional probability $$p(A|B)$$ of a variable A given the other variable B tells you how likely the event A is assuming the event B happens. $$A$$ and $$B$$ are independent if $$p(A|B)=p(A)$$ (note that it's unlikely to be exactly equal in the case of a real sample).

I believe that if an event happening in locations B and C are dependant, I should sum the 2 columns together as 1 feature in my model.

Unless you have a specific reason to do that (e.g. you want to consider a large area which includes locations B and C), this doesn't make a lot of sense:

• first dependency is not "all or nothing", two variables can have a certain degree of dependency but it doesn't mean that they follow each other exactly. Therefore you would lose some information by merging them into one feature.
• this would make it impossible to predict future events for a specific location, for instance B, if the two values for B and C are combined together.