Skip to content

API

AbstractItemResponseModels.Continuous Type
julia
Continous <: ResponseType

Defines that an ItemResponseModel has a continous response variable.

source

AbstractItemResponseModels.Dichotomous Type
julia
Dichotomous <: ResponseType

Defines that an ItemResponseModel has a binary response variable.

source

AbstractItemResponseModels.DistributionEstimate Type
julia
DistributionEstimate <: EstimationType

Defines that the parameters of an ItemResponseModel are estimated by a distribution. Thus, parameters for a model with estimation_type(model) == DistributionEstimate are probability distributions that implement common interface functions for distributions, e.g. rand, mean, or quantile.

source

AbstractItemResponseModels.EstimationType Type
julia
EstimationType

The EstimationType of an ItemResponseModel describes the type of parameter estimation for the model.

source

AbstractItemResponseModels.ItemResponseModel Type
julia
ItemResponseModel

An abstract type representing an item response theory model.

Each implementation T <: ItemResponseModel must define the following traits:

Additionally T <: ItemResponseModel must implement the following interface:

  • irf: An item response function returning the probability that a person with given ability estimate will answer an item with a particular response.

  • iif: An item information function returning the information of answering with a particular response on an item given an ability estimate.

  • expected_score: An expected score function returning the expected score for one or multiple items, given an ability estimate.

  • information: An information function returning the information of one or multiple items, given an ability estimate.

  • fit: A function fitting an item response model of type T to observed data.

  • get_item_locations: A function returning the item locations for a given item.

  • get_person_locations: A function returning the person locations for a given person.

source

AbstractItemResponseModels.Nominal Type
julia
Nominal <: ResponseType

Defines that an ItemResponseModel has an unordered categorical response variable.

source

AbstractItemResponseModels.Ordinal Type
julia
Ordinal <: ResponseType

Defines that an ItemResponseModel has an ordered categorical response variable.

source

AbstractItemResponseModels.PointEstimate Type
julia
PointEstimate <: EstimationType

Defines that the parameters of an ItemResponseModel are estimated by a single point estimate. Thus, parameters for a model with estimation_type(model) == PointEstimate are single real-valued numbers.

source

AbstractItemResponseModels.ResponseType Type
julia
ResponseType

The ResponseType defines the scale level of item responses for a given ItemResponseModel.

source

AbstractItemResponseModels.SamplingEstimate Type
julia
SamplingEstimate <: EstimationType

Defines that the parameters of an ItemResponseModel are estimated by a sampling procedure. Thus, parameters for a model with estimation_type(model) == SamplingEstimate are vectors of real-valued numbers where the length of the parameter vector is equal to the number of samples drawn.

source

AbstractItemResponseModels.check_response_type Method
julia
check_response_type(::T, itr) where {T<:ResponseType}

Check if the responses in itr are valid for ResponseType T.

If all responses are valid, nothing is returned.

If any invalid responses are found, a DomainError is thrown.

source

AbstractItemResponseModels.dimensionality Method
julia
dimensionality

Return a tuple of the dimensions for an ItemResponseModel where the first element corresponds to the person dimensionality and the second element to the item dimensionality.

source

AbstractItemResponseModels.each_item_index Method
julia
each_item_index(model::ItemResponseModel)

Create an iterable object visiting each item index of an item response model.

source

AbstractItemResponseModels.each_person_index Method
julia
each_person_index(model::ItemResponseModel)

Create an iterable object visiting each person index of an item response model.

source

AbstractItemResponseModels.estimation_type Method
julia
estimation_type(model::ItemResponseModel)

Return the EstimationType of an [ItemResponseModel].

source

AbstractItemResponseModels.expected_score Function
julia
expected_score(model::ItemResponseModel, theta; scoring_function)
expected_score(model::ItemResponseModel, theta, is; scoring_function)

Calculate the expected score of an ItemResponseModel.

Arguments

  • model: An ItemResponseModel

  • theta: The person parameter value(s)

  • is: One or multiple item identifiers. If is is omitted, the expected score for the whole test is returned.

Keyword arguments

  • scoring_function: A binary function of the form f(y, ctx) = x, mapping all possible response values y to

a value x. The argument ctx contains the current item context.

Return values

If estimation_type(model) == PointEstimate then expected_score must return a single scalar value.

If estimation_type(model) == SamplingEstimate then expected_score must return a vector of values with the length equal to the number of samples drawn.

source

AbstractItemResponseModels.get_item_locations Method
julia
get_item_locations(model::ItemResponseModel, i)

Get the item locations for an item from an ItemResponseModel.

Arguments

Return values

If item_dimensionality(model) == Univariate and estimation_type(model) == PointEstimate then get_item_locations must return a single scalar value.

If item_dimensionality(model) == Multivariate and estimation_type(model) == PointEstimate then get_item_locations must return a vector of values corresponding to the dimensionality of the item parameters.

If item_dimensionality(model) == Univariate and estimation_type(model) == SamplingEstimate then get_item_locations must return a vector of values with the length equal to the number of samples drawn.

If item_dimensionality(model) == Multivariate and estimation_type(model) == SamplingEstimate then get_item_locations must return a matrix with rows corresponding to the drawn samples and columns corresponding to the dimension of the item parameter.

source

AbstractItemResponseModels.get_person_locations Method
julia
get_person_locations(model::ItemResponseModel, p)

Get the person locations for an person from an ItemResponseModel.

Arguments

Return values

If person_dimensionality(model) == Univariate and estimation_type(model) == PointEstimate then get_person_locations must return a single scalar value.

If person_dimensionality(model) == Multivariate and estimation_type(model) == PointEstimate then get_person_locations must return a vector of values corresponding to the dimensionality of the person parameters.

If person_dimensionality(model) == Univariate and estimation_type(model) == SamplingEstimate then get_person_locations must return a vector of values with the length equal to the number of samples drawn.

If person_dimensionality(model) == Multivariate and estimation_type(model) == SamplingEstimate then get_person_locations must return a matrix with rows corresponding to the drawn samples and columns corresponding to the dimension of the person parameter.

source

AbstractItemResponseModels.iif Function
julia
iif(model::ItemResponseModel, theta, i)
iif(model::ItemResponseModel, theta, i, y)

Arguments

  • model: An ItemResponseModel

  • theta: The person parameter value(s)

  • i: A unique item identifier

  • y: Response value(s)

Return values

If estimation_type(model) == PointEstimate then the item information function must return a scalar value.

If estimation_type(model) == SamplingEstimate then the item information function must return a vector of values with the length equal to the number of samples drawn.

source

AbstractItemResponseModels.information Function
julia
information(model::ItemResponseModel, theta; scoring_function)
information(model::ItemResponseModel, theta, is; scoring_function)

Calculate the information of an ItemResponseModel.

Arguments

  • theta: The person parameter value(s)

  • is: One or multiple item identifiers. If is is omitted, the information of the whole test (test information) is returned.

Keyword arguments

  • scoring_function: A binary function of the form f(y, ctx) = x, mapping all possible response values y to

a value x. The argument ctx contains the current item context.

Return values

If estimatione_type(model) == PointEstimate then information must return a single scalar value.

If estimation_type(model) == SamplingEstimate then information must return a vector of values with the length equal to the number of samples drawn.

source

AbstractItemResponseModels.irf Function
julia
irf(model::ItemResponseModel, theta, i)
irf(model::ItemResponseModel, theta, i, y)

Evaluate the item response function of an ItemResponseModel.

Arguments

  • model: An ItemResponseModel

  • theta: The person parameter value(s)

  • i: A unique item identifier

  • y: Response value(s)

Return values

If estimation_type(model) == PointEstimate then the item response function must return a scalar value.

If estimation_type(model) == SamplingEstimate then the item response function must return a vector of values with the length equal to the number of samples.

source

AbstractItemResponseModels.item_dimensionality Method
julia
item_dimensionality(model::ItemResponseModel)

Return the number of dimensions for the item parameters of an ItemResponseModel as an integer.

source

AbstractItemResponseModels.person_dimensionality Method
julia
person_dimensionality(model::ItemResponseModel)

Return the number of dimensions for the person parameters of an ItemResponseModel as an integer.

source

AbstractItemResponseModels.response_type Method
julia
response_type(model::ItemResponseModel)
response_type(::Type{<:ItemResponseModel})

Return the ResponseType of an ItemResponseModel.

source

StatsAPI.fit Function
julia
fit(::Type{T}, data::AbstractMatrix, args...; kwargs...)

Fit an item response model to response data.

Arguments

  • data: The observed response data. If data is a response matrix, the columns must describe items and rows describe persons.

  • args...: Additional arguments required to fit the ItemResponseModel

Keyword arguments

Return values

A fitted model with T <: ItemResponseModel.

source

AbstractItemResponseModels.Tests.FakeIRM Type
julia
FakeIRM{RT<:ResponseType,PD<:Dimensionality,ID<:Dimensionality}

A minimal implementation of ItemResponseModel for interface testing.

source

AbstractItemResponseModels.Tests.test_interface Method
julia
test_interface(T::Type{<:ItemResponseModel}, data, args...; kwargs...)

Test the implementation of an item response model interface.

Arguments

  • T: The implemented model type

  • data: observed data

  • args...: Additional arguments passed to fit

Keyword arguments

  • kwargs...: Additional keyword arguments passed to fit

source