/** * Item Response Theory (IRT) * * Implements the 1PL (Rasch), 2PL, and 3PL IRT models for: * - Calculating probability of correct response * - Estimating learner ability (theta) * - Calculating item information * - Adaptive item selection * * @see Lord, F.M. (1980). Applications of item response theory to practical testing problems. * * @packageDocumentation */ import type { IRTParameters, IRTAbilityEstimate, IRTConfig, QuestionId } from '../types/index.js'; /** * Default IRT configuration */ export declare const IRT_CONFIG_DEFAULTS: Required; /** * IRT response data for estimation */ export interface IRTResponse { /** Question ID */ questionId: QuestionId; /** Item parameters */ params: IRTParameters; /** Whether response was correct */ correct: boolean; } /** * Calculate probability of correct response using IRT model * * 1PL (Rasch): P(θ) = 1 / (1 + exp(-(θ - b))) * 2PL: P(θ) = 1 / (1 + exp(-a(θ - b))) * 3PL: P(θ) = c + (1 - c) / (1 + exp(-a(θ - b))) * * @param theta - Ability parameter * @param params - Item parameters * @returns Probability of correct response (0-1) */ export declare function calculateProbability(theta: number, params: IRTParameters): number; /** * Calculate the first derivative of P with respect to theta * Used in ability estimation */ export declare function calculateProbabilityDerivative(theta: number, params: IRTParameters): number; /** * Calculate Fisher Information for an item at a given ability * * Information represents how precisely the item measures ability at theta. * Higher information = more useful for measuring that ability level. * * I(θ) = [P'(θ)]² / [P(θ)(1-P(θ))] */ export declare function calculateInformation(theta: number, params: IRTParameters): number; /** * Calculate test information (sum of item information) */ export declare function calculateTestInformation(theta: number, items: IRTParameters[]): number; /** * Calculate standard error of ability estimate * SE(θ) = 1 / √I(θ) */ export declare function calculateStandardError(theta: number, items: IRTParameters[]): number; /** * IRT Ability Estimator * * Estimates learner ability (theta) from response patterns using * Maximum Likelihood Estimation (MLE) or Expected A Posteriori (EAP). */ export declare class IRTEstimator { private readonly config; constructor(config?: IRTConfig); /** * Estimate ability using Maximum Likelihood Estimation (MLE) * * Uses Newton-Raphson iteration to find the theta that maximizes * the likelihood of the observed response pattern. */ estimateMLE(responses: IRTResponse[]): IRTAbilityEstimate; /** * Estimate ability using Expected A Posteriori (EAP) * * Uses numerical integration with a prior distribution. * More stable than MLE, especially with few responses. */ estimateEAP(responses: IRTResponse[]): IRTAbilityEstimate; /** * Estimate ability using Maximum A Posteriori (MAP) * * Like MLE but includes prior distribution. */ estimateMAP(responses: IRTResponse[]): IRTAbilityEstimate; /** * Auto-select best estimation method based on response count */ estimate(responses: IRTResponse[]): IRTAbilityEstimate; /** * Calculate log-likelihood derivatives for Newton-Raphson */ private calculateDerivatives; /** * Calculate likelihood of response pattern */ private calculateLikelihood; /** * Normal PDF for prior */ private normalPDF; /** * Build ability estimate result */ private buildEstimate; /** * Default estimate when no responses */ private defaultEstimate; /** * Handle extreme response patterns */ private extremeEstimate; } /** * Select next item for adaptive testing using Maximum Fisher Information * * Selects the item that provides the most information at the current ability estimate. */ export declare function selectNextItemMFI(currentTheta: number, availableItems: { id: QuestionId; params: IRTParameters; }[], administeredIds: Set): { id: QuestionId; params: IRTParameters; information: number; } | null; /** * Convert ability (theta) to percentile * * Assumes standard normal distribution of ability. */ export declare function abilityToPercentile(theta: number): number; /** * Convert ability to grade-level equivalent (rough approximation) * * Maps theta to approximate grade level (K-12 scale). */ export declare function abilityToGradeLevel(theta: number): number; /** * Create an IRT estimator */ export declare function createIRTEstimator(config?: IRTConfig): IRTEstimator; /** * Quick ability estimation using EAP */ export declare function estimateAbility(responses: { params: IRTParameters; correct: boolean; }[], config?: IRTConfig): number; //# sourceMappingURL=irt.d.ts.map