Statistical Tests and Estimators of the Rank of a Matrix and Their Applications in Econometric Modelling