sim.data.MGGUM: Simulate Data from the Multidimensional Generalized Graded...

View source: R/sim.data.MGGUM.R

sim.data.MGGUMR Documentation

Simulate Data from the Multidimensional Generalized Graded Unfolding Model

Description

Generates polytomous responses from the same distance-based MGGUM probability function used by model.MGGUM and fit.MGGUM. For each item, active discriminations are drawn from U(0.5, 2), active locations follow the sign of the Q-matrix, \tau_{i0}=0, and the remaining \tau values are ordered negative thresholds.

Usage

sim.data.MGGUM(
  N = 500,
  I = 20,
  D = 2,
  length.poly = 5,
  Q.matrix = NULL,
  Corr = NULL
)

Arguments

N

Integer; number of examinees (default: 500).

I

Integer; number of items (default: 20).

D

Integer; number of latent dimensions (default: 2).

length.poly

Integer vector or scalar indicating the number of categories for each item. A scalar is recycled to length I.

Q.matrix

Optional I \times D matrix with values -1, 0, or 1.

  • 1: active dimension with positive-side delta

  • -1: active dimension with negative-side delta

  • 0: a and delta fixed to 0 (inactive dimension)

The sign controls the item-location side, not the sign of discrimination. If NULL, a default matrix of randomly signed active entries is used.

Corr

Optional D \times D correlation matrix. If NULL, the identity matrix is used.

Value

An object of class "data.MGGUM", a list containing:

data, response

N \times I integer response matrices with categories coded from 0 to K_i - 1.

theta

N \times D matrix of true latent traits.

par

I \times (2D + \max_i K_i) matrix of GGUM item parameters: discrimination columns, location columns, and stacked threshold columns.

probability

N \times \sum_i K_i matrix of stacked category probabilities.

Q.matrix, length.poly, Corr

Design matrix, category counts, and latent correlation matrix used to generate the data.

N, I, D, call

Data-generating metadata.

Data Generation Process

  1. Draw latent traits from N_D(\mathbf{0}, \boldsymbol{\Sigma}).

  2. Generate discrimination, location, and threshold parameters under the sign constraints encoded by Q.matrix.

  3. Compute stacked category probabilities with model.MGGUM.

  4. Sample one ordinal response per person and item. A category can be absent in a finite sample; length.poly retains the intended support.

See Also

fit.MGGUM, model.MGGUM

Examples

set.seed(123)
sim <- sim.data.MGGUM(N = 20, I = 5, D = 2, length.poly = 4)
str(sim$response)
dim(sim$par)
table(sim$response[, 1])


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