Pearson correlation coefficient between two time series How do i compare two time series:(Pearson correlation coefficient)
1st time series is generated by google trends for search term "India"
2nd time series is Foreign Tourist Arrivals(absolute value of arrivals) to India each month.
 A: The simple way to compute it is to pair up all observations at the same time and compute the sample Pearson's correlation (this is what Google Correlate does)
For example, Let's say you want to correlate the time series $S_1$ and $S_2$:
 time S_1     S_2
 t_1  20.4400 19.7450
 t_2  19.0750 20.3300
 t_3  20.0650 20.1700
 ..   ..      ..

Which might look like this when plotted:

You just have to use this formula:
$$
r(S_1,S_2) \triangleq \frac{ \sum_{k=1}^n (S_1(t_k) - \bar{S_1})(S_2(t_k) - \bar{S_2})  }{ \sqrt{ \sum_{k=1}^n (S_1(t_k)- \bar{S_1})^2 \sum_{k=1}^n (S_2(t_k) - \bar{S_2})^2 }}
$$
where $S_1(t_k)$ is a particular value of the time series $S_1$ at time $t_k$, and $\bar{S_1}$ is the average value of $S_1$.
(Just look at the formula of the sample Pearson's correlation between two variables $X$ and $Y$, from wikipedia)
As Gung said, there are different approaches to tackle this problem. Pearson's correlation is good if you are interested in linear correlations, which are very intuitive. There are other measures of dependencies which identify non-linear relationships. I can point you out to a presentation I prepared (hope it is not too shameful to add something of mine here) 
