mml_approx

def mml_approx(dataset, discrimination=1, scalar=None)

Difficulty parameter estimates of IRT model.

Analytic estimates of the difficulty parameters in an IRT model assuming a normal distribution .

Args

dataset
[items x participants] matrix of True/False Values
discrimination
scalar of discrimination used in model (default to 1)
scalar
(1d array) logarithm of "false counts" to "true counts" (log(n_no / n_yes))

Returns

difficulty
(1d array) difficulty estimates
Expand source code
def mml_approx(dataset, discrimination=1, scalar=None):
    """ Difficulty parameter estimates of IRT model.
    
    Analytic estimates of the difficulty parameters 
    in an IRT model assuming a normal distribution .

    Args:
        dataset: [items x participants] matrix of True/False Values
        discrimination: scalar of discrimination used in model (default to 1)
        scalar: (1d array) logarithm of "false counts" to "true counts" (log(n_no / n_yes))

    Returns:
        difficulty: (1d array) difficulty estimates
    """
    if scalar is None:
        n_no, n_yes = get_true_false_counts(dataset)
        scalar = np.log(n_no / n_yes)

    return (np.sqrt(1 + discrimination**2 / 3) *
            scalar / discrimination)