Exemplo n.º 1
0
from joint import Joint

value1 = Beta(0.5, 0.5)
value2 = Beta(2.0, 5.0)

joint_sum = Joint(value1, value2, "Sum")
joint_quotient = Joint(value1, value2, "Quotient")
joint_product = Joint(value1, value2, "Product")
joint_quadro_sum = Joint(value1, value2, "QuadroSum")
joint_min = Joint(value1, value2, "Min")
joint_max = Joint(value1, value2, "Max")

print("BETA VALUE 1", value1.mean, value1.variance, value1.pdf(0.5), value1.cdf(0.5))
print("BETA VALUE 2", value2.mean, value2.variance, value2.pdf(0.5), value2.cdf(0.5))

print("JOINT SUM", joint_sum.mean, joint_sum.variance, joint_sum.pdf(0.5), joint_sum.cdf(0.5))
print("JOINT QUOTIENT", joint_quotient.mean, joint_quotient.variance, joint_quotient.pdf(0.5), joint_quotient.cdf(0.5))
print("JOINT PRODUCT", joint_product.mean, joint_product.variance, joint_product.pdf(0.5), joint_product.cdf(0.5))
print(
    "JOINT QUADRO SUM",
    joint_quadro_sum.mean,
    joint_quadro_sum.variance,
    joint_quadro_sum.pdf(0.5),
    joint_quadro_sum.cdf(0.5),
)
print("JOINT MIN", joint_min.mean, joint_min.variance, joint_min.pdf(0.5), joint_min.cdf(0.5))
print("JOINT MAX", joint_max.mean, joint_max.variance, joint_max.pdf(0.5), joint_max.cdf(0.5))

joint_sum.show("pdf")
# joint_quotient.show("pdf")
# joint_product.show("pdf")
Exemplo n.º 2
0
value1 = Beta(1.0, 5.0)
value2 = Beta(5.0, 3.0)

joint_sum = Joint(value1, value2, "Sum")
joint_quotient = Joint(value1, value2, "Quotient")
joint_product = Joint(value1, value2, "Product")
joint_quadro_sum = Joint(value1, value2, "QuadroSum")
joint_min = Joint(value1, value2, "Min")
joint_max = Joint(value1, value2, "Max")

print("BETA VALUE 1", value1.mean, value1.variance, value1.pdf(0.5), value1.cdf(0.5), value1.norm)
print("BETA VALUE 2", value2.mean, value2.variance, value2.pdf(0.5), value2.cdf(0.5), value2.norm)

# print ("JOINT SUM", joint_sum.mean, joint_sum.variance, joint_sum.pdf(0.5), joint_sum.cdf(0.5))
print("JOINT SUM", joint_sum.mean, joint_sum.variance, joint_sum.pdf(0.5), joint_sum.cdf(0.5), joint_sum.norm)
print(
    "JOINT QUOTIENT",
    joint_quotient.mean,
    joint_quotient.variance,
    joint_quotient.pdf(0.5),
    joint_quotient.cdf(0.5),
    joint_quotient.norm,
)
print(
    "JOINT PRODUCT",
    joint_product.mean,
    joint_product.variance,
    joint_product.pdf(0.5),
    joint_product.cdf(0.5),
    joint_product.norm,