In [1]:
import choix
import numpy as np
np.set_printoptions(precision=3, suppress=True)
In [2]:
n_items = 8
data = [
(7, 3), (2, 0), (5, 2), (4, 2), (2, 1),
(4, 5), (6, 3), (5, 4), (7, 0), (2, 3),
(4, 0), (0, 4), (6, 5), (3, 2), (3, 4),
(3, 4), (5, 2), (7, 3), (7, 6), (6, 5),
]
In [3]:
mean, cov = choix.ep_pairwise(n_items, data, 0.1, model="logit")
print("mean:")
print(mean)
print("\ncovariance:")
print(cov)
print("\ntotal variance: {:3f}".format(np.trace(cov)))
In [4]:
mean, cov = choix.ep_pairwise(n_items, data, 0.1, model="probit")
print("mean:")
print(mean)
print("\ncovariance:")
print(cov)
print("\ntotal variance: {:3f}".format(np.trace(cov)))