Statistics for Problems in cosmology and numerical relativity