loglik_thirt: Calculate log-likelihood

View source: R/likelihood.R

loglik_thirtR Documentation

Calculate log-likelihood

Description

Calculate log-likelihood

Usage

loglik_thirt(gamma, items, persons, resp)

Arguments

gamma

a data.frame of length ⁠[total binary outcomes]⁠ with two variables: variable pair of the format i-j for item pair ij, variable gamma for threshold parameters.

items

a data.frame of length ⁠[total items]⁠ with five variables: variable item of the format i for item number i, variable block of the format b for block number b, variable dim of the format d for dimension number d, variable lambda for loadings, variable psisq for uniqueness, variable dim for dimensions.

persons

a data.frame of length ⁠[number of people]⁠ with variables: variable person of the format p for person number p, variables named theta_d for dimension number d.

resp

a data.frame of length ⁠[n_person x n_block]⁠ with at least three first variables: variable person of the format p for person number p, variable block of the format b for block number b, variable resp of the format r for response number r which corresponds to mupp::find_permutation_index().

Value

a matrix of dimensions ⁠[n_person X n_block]⁠ of log-likelihoods of chosen responses for each person for each block.

Examples


## Not run: 
set.seed(202106)

params   <- simulate_thirt_params()

gamma    <- params$gamma
items    <- params$items
persons  <- params$persons
resp     <- do.call(simulate_thirt_resp, params)$resp

loglik_thirt(gamma = gamma, items = items, persons = persons, resp = resp)

## End(Not run)


nguyenllpsych/thirt documentation built on Feb. 14, 2024, 10:53 p.m.