def variance(self, setting: InitObsSetting, *, atol: float = 1e-8):
        """Compute the variance of the estimators of the given setting.

        This is the normal variance divided by the number of samples to estimate
        the certainty of our estimate of the mean. It is the standard error
        of the mean, squared.

        This uses `ddof=1` during the call to `np.var` for an unbiased estimator
        of the variance in a hypothetical infinite population for consistency
        with `BitstringAccumulator.covariance()` but differs from the default
        for `np.var`.

        Args:
            setting: The initial state and observable.
            atol: The absolute tolerance for asserting coefficients are real.

        Raises:
            ValueError: If there were no measurements.
        """
        if len(self.bitstrings) == 0:
            raise ValueError("No measurements")
        self._validate_setting(setting, what='variance')

        mean, var = _stats_from_measurements(
            bitstrings=self.bitstrings,
            qubit_to_index=self._qubit_to_index,
            observable=setting.observable,
            atol=atol,
        )

        if self._readout_calibration is not None:
            a = mean
            if np.isclose(a, 0, atol=atol):
                return np.inf
            var_a = var
            ro_setting = _setting_to_z_observable(setting)
            b = self._readout_calibration.mean(ro_setting)
            if np.isclose(b, 0, atol=atol):
                return np.inf
            var_b = self._readout_calibration.variance(ro_setting)
            f = a / b

            # https://en.wikipedia.org/wiki/Propagation_of_uncertainty#Example_formulae
            # assume cov(a,b) = 0, otherwise there would be another term.
            var = f**2 * (var_a / (a**2) + var_b / (b**2))

        return var
Compute the variance of the estimators of the given setting.

        This is the normal variance divided by the number of samples to estimate
        the certainty of our estimate of the mean. It is the standard error
        of the mean, squared.

        This uses `ddof=1` during the call to `np.var` for an unbiased estimator
        of the variance in a hypothetical infinite population for consistency
        with `BitstringAccumulator.covariance()` but differs from the default
        for `np.var`.

        Args:
            setting: The initial state and observable.
            atol: The absolute tolerance for asserting coefficients are real.

        Raises:
            ValueError: If there were no measurements.
        
cirq-core/cirq/work/observable_measurement_data.py