Hello, the betas are the cointegrating coefficients. For example, if beta = (1, -0.5), it means the pair = 1*S1 – 0.5*S2 is cointegrated.
The convention is that confidence interval = 1 – quantile. So, if you want 90% confidence, you want to set level = 0.1. That is, in your code,
int r = johansenTest.r(coint, 0.1);//90% confidence interval<br />
There is no such concept of “compare pairs of stocks by cointegration”. A pair is either cointegrated or not. There is no such thing as “one is more cointegrated than another”.
Again, if you run MovingCointegration.java in AlgoQuant, you will find it is pretty difficult to find something that are cointegrated… (you had a bug in your previous code snippet.)