コード例 #1
0
            param_string += "]"
        else:
            param_string += ", "

    print(" parameters: %s" % param_string)

    # get diameter for entire cuboid
    lb, ub = [lower_bounds], [upper_bounds]
    cuboid_volume = volume(lb[0], ub[0])
    params0, subdiams0, diam0, probmass0 = test_cuboids(lb,ub,RVstart,RVend,\
                                                        cuboid_volume)
    SOLVED_PARAMETERS, SUB_DIAMETERS = params0, subdiams0
    TOTAL_DIAMETERS, PROBABILITY_MASS = diam0, probmass0

    if not DEBUG:
        failure, success = sample(model, lb[0], ub[0])
        pof = float(failure) / float(failure + success)
        print("Exact PoF: %s" % pof)

        for i in range(len(lb)):
            print("\n")
            print(" lower bounds: %s" % lb[i])
            print(" upper bounds: %s" % ub[i])
        for solved in params0[0]:
            print("solved: %s" % solved)
        print("subdiameters (squared): %s" % subdiams0[0])
        print("diameter (squared): %s" % diam0[0])
        print(" probability mass: %s" % probmass0[0])
        expectation = expectation_value(model, lower_bounds, upper_bounds)
        print(" expectation: %s" % expectation)
        mean_value = mean(expectation, cuboid_volume)
コード例 #2
0
        if i == (RVmax - 1):
            param_string += "]"
        else:
            param_string += ", "

    print " parameters: %s" % param_string

    # get diameter for entire cuboid
    lb, ub = [lower_bounds], [upper_bounds]
    cuboid_volume = volume(lb[0], ub[0])
    params0, subdiams0, diam0, probmass0 = test_cuboids(lb, ub, RVstart, RVend, cuboid_volume)
    SOLVED_PARAMETERS, SUB_DIAMETERS = params0, subdiams0
    TOTAL_DIAMETERS, PROBABILITY_MASS = diam0, probmass0

    if not DEBUG:
        failure, success = sample(model, lb[0], ub[0])
        pof = float(failure) / float(failure + success)
        print "Exact PoF: %s" % pof

        for i in range(len(lb)):
            print "\n"
            print " lower bounds: %s" % lb[i]
            print " upper bounds: %s" % ub[i]
        for solved in params0[0]:
            print "solved: %s" % solved
        print "subdiameters (squared): %s" % subdiams0[0]
        print "diameter (squared): %s" % diam0[0]
        print " probability mass: %s" % probmass0[0]
        expectation = expectation_value(model, lower_bounds, upper_bounds)
        print " expectation: %s" % expectation
        mean_value = mean(expectation, cuboid_volume)