check parameters before random sample