Solved – How to test the variance in timeseries

covariancevariance

I have a doubt regarding the variance, I try to explain It with an example.

I have two vectors, like:

a <- c(1:10)
1  2  3  4  5  6  7  8  9 10

b <- c(10:1)
10  9  8  7  6  5  4  3  2  1

the variance is obviouly the same:

> var(a)
9.166667
> var(b)
9.166667

Ok, I need to test if the variances are similar, and for this test I use var.test().

The problem is that the variances are equals, OK! but the follow a different direction, the first move from 1 to 10 and the second from 10 to 1. SO the variances are the same and the test pass successfully(obviously), but I need also check the direction, so:

  1. Are the variances similar? Ok…
  2. Are the variances (I know 'variances' here is wrong but try to understand what I mean reading the example above) moving in the same direction?

With the same direction I mean, the variance is equal(similar) BUT are they UP/DOWN togheter?

I need to do those checks because I'm analyzing two financial lists of prices, and I need to know if the variance between their returns is constant and on the same direction.

How Can I do?

Thanks!

Best Answer

I would suggest covariance because it will tell you direction with variance. e.g.,

cov(a,b)= -9.16667

you can also do correlation test in R. e.g., cor.test(a,b)

Related Question