resolve_fc_blocks: Resolve forced-choice block and Q-matrix configuration

View source: R/sim-utils.R

resolve_fc_blocksR Documentation

Resolve forced-choice block and Q-matrix configuration

Description

Shared validation and auto-generation logic used by sim.data.FCMIRT, sim.data.FCGGUM, sim.data.FCGDINA, and sim.data.TIRT.

Usage

resolve_fc_blocks(
  Q.matrix,
  block.items,
  I.block,
  N.block,
  D,
  q.valid.values,
  q.row.check
)

Arguments

Q.matrix

User-supplied Q-matrix or NULL.

block.items

User-supplied block-item list or NULL.

I.block

Default items-per-block (scalar).

N.block

Default number of blocks (scalar).

D

Default number of dimensions (scalar).

q.valid.values

Allowed Q-matrix values (e.g. c(0, 1) for MIRT/DCM, c(-1, 0, 1) for GGUM/TIRT).

q.row.check

Function applied to each row of Q.matrix; must return TRUE for every row. Example: function(r) any(r != 0) or function(r) sum(abs(r)) == 1L.

Value

A named list with components I.states, N.block, I.block, block.items, Q.matrix, D. Q.matrix is NULL if it was not supplied and should be generated later (e.g. by sim.Q.matrix.FC or sim.data.Q.CDM).


ForceChoice documentation built on Sept. 13, 2026, 1:06 a.m.