On determination of cointegration ranks