示例#1
0
 def analytical_method(container, container_type, norm_type, variable):
     analytical_value = GetInitialVariableValue(variable, norm_type)
     for item in container:
         analytical_value += SpatialMethodTests.__GetNormValue(
             variable,
             SpatialMethodTests.__GetValue(item, container_type,
                                           variable), norm_type)
     return analytical_value
示例#2
0
        def analytical_method(container, container_type, norm_type, variable):
            mean_value = GetInitialVariableValue(variable, norm_type)
            variance_value = GetInitialVariableValue(variable, norm_type)
            for item in container:
                current_value = SpatialMethodTests.__GetNormValue(
                    variable,
                    SpatialMethodTests.__GetValue(item, container_type,
                                                  variable), norm_type)
                mean_value += current_value
                variance_value += KratosStats.MethodUtilities.RaiseToPower(
                    current_value, 2)

            n = len(container)
            mean_value /= n
            variance_value = variance_value / n - KratosStats.MethodUtilities.RaiseToPower(
                mean_value, 2)

            return mean_value, variance_value
示例#3
0
        def analytical_method(container, container_type, norm_type, variable):
            analytical_value = GetInitialVariableValue(variable, norm_type)
            for item in container:
                analytical_value += KratosStats.MethodUtilities.RaiseToPower(
                    SpatialMethodTests.__GetNormValue(
                        variable,
                        SpatialMethodTests.__GetValue(item, container_type,
                                                      variable), norm_type), 2)

            return KratosStats.MethodUtilities.RaiseToPower(
                analytical_value * (1.0 / len(container)), 0.5)
示例#4
0
    def __AnalyticalMethod(norm_type, variable, value_array):
        if (norm_type == "none"):
            result = GetInitialVariableValue(variable, "none")
            for item in value_array:
                result += item
        else:
            result = 0.0
            norm_method = KratosStats.MethodUtilities.GetNormMethod(
                variable, norm_type)
            for item in value_array:
                result += norm_method(item)

        return result * 2.0
    def __AnalyticalMethod(norm_type, variable, value_array):
        if (norm_type == "none"):
            result = GetInitialVariableValue(variable, "none")
            for item in value_array:
                result += KratosStats.MethodUtilities.RaiseToPower(item, 2) * 2.0
        else:
            result = 0.0
            norm_method = KratosStats.MethodUtilities.GetNormMethod(
                variable, norm_type)
            for item in value_array:
                result += pow(norm_method(item), 2.0) * 2.0

        return KratosStats.MethodUtilities.RaiseToPower(result * (1.0 / max(len(value_array) * 2.0, 1.0)), 0.5)
    def __AnalyticalMethod(norm_type, variable, value_array):
        if (norm_type == "none"):
            result_mean = GetInitialVariableValue(variable, "none")
            result_variance = GetInitialVariableValue(variable, "none")
            for item in value_array:
                result_mean += item * 2.0
                result_variance += KratosStats.MethodUtilities.RaiseToPower(
                    item, 2) * 2.0
        else:
            result_mean = 0.0
            result_variance = 0.0
            norm_method = KratosStats.MethodUtilities.GetNormMethod(
                variable, norm_type)
            for item in value_array:
                value = norm_method(item)
                result_mean += value * 2.0
                result_variance += pow(value, 2) * 2.0

        result_mean = result_mean * (1.0 / max(len(value_array) * 2.0, 1.0))
        result_variance = result_variance * (
            1.0 / max(len(value_array) * 2.0, 1.0)
        ) - KratosStats.MethodUtilities.RaiseToPower(result_mean, 2)
        return result_mean, result_variance