Statistics for Obtaining the spacetime metric from cosmological observations