Mô hình IRT 3PL
https://drive.google.com/file/d/19YQB_WOZsrdtPYuDLEYdZz2r0tgvG5tf/view?usp=sharing import pandas as pd import numpy as np from scipy.optimize import minimize # Hàm logistic 3PL def logistic_3pl(theta, a, b, c): return c + (1 - c) / (1 + np.exp(-a * (theta - b))) # Hàm likelihood để tối ưu hóa tham số câu hỏi def likelihood_3pl(params, theta, responses): a, b, c = params prob = logistic_3pl(theta, a, b, c) return -np.sum(responses * np.log(prob) + (1 - responses) * np.log(1 - prob)) # Hàm tối ưu hóa tham số câu hỏi def estimate_item_params_3pl(responses, initial_params=(1, 0, 0.2)): n_items = responses.shape[1] item_params = [] for i in range(n_items): result = minimize( likelihood_3pl, x0=initial_params, args=(0, responses[:, i]), # ...