Esempio n. 1
0
def test_rms_rmse():
    """

    Test the rms and rmse functions

    """

    # They both give the same answer:
    data = np.random.randn(10)
    npt.assert_equal(ozu.rms(data), ozu.rmse(data, np.zeros(data.shape)))
Esempio n. 2
0
def test_rms_rmse():
    """

    Test the rms and rmse functions

    """

    # They both give the same answer:
    data = np.random.randn(10)
    npt.assert_equal(ozu.rms(data), ozu.rmse(data, np.zeros(data.shape)))
Esempio n. 3
0
    def rRMSE(self):
        """
        This is a measure of goodness of fit, based on a relative RMSE measure
        between the RMSE of the fit residuals and the actual signal and the RMS
        of the (mean-removed) b0 measurements.
    
        """

        # Get the RMSE of the model relative to the actual data:
        rmse_model = np.sqrt(np.mean(self.residuals**2, -1))

        # Normalize that to the variance in the b0, which is an estimate of data
        # reliability:
        rms_b0 = ozu.rms(self.data[..., self.b0_idx] -
                         np.mean(self.S0)[..., np.newaxis])

        return rmse_model / rms_b0
Esempio n. 4
0
    def rRMSE(self):
        """
        This is a measure of goodness of fit, based on a relative RMSE measure
        between the RMSE of the fit residuals and the actual signal and the RMS
        of the (mean-removed) b0 measurements.
    
        """
        
        # Get the RMSE of the model relative to the actual data: 
        rmse_model = np.sqrt(np.mean(self.residuals**2, -1))

        # Normalize that to the variance in the b0, which is an estimate of data
        # reliability:
        rms_b0 = ozu.rms(self.data[...,self.b0_idx]-
                         np.mean(self.S0)[...,np.newaxis])

        return rmse_model/rms_b0