Method of Monte Carlo grid for data analysis