check rank of design matrix

Signed-off-by: Zarrar Shehzad <czarrar@gmail.com>