update: S3 Methods: update

updateR Documentation

S3 Methods: update

Description

The update function provides a unified and convenient interface to re-fit ForceChoice models with modified parameter settings while preserving all other original configurations. It allows users to change the estimation method, adjust control parameters, increase dimensionality, or switch model specifications without re-specifying the entire call.

Usage

## S3 method for class 'MIRT'
update(object, ...)

## S3 method for class 'MGPCM'
update(object, ...)

## S3 method for class 'MGGUM'
update(object, ...)

## S3 method for class 'FCMIRT'
update(object, ...)

## S3 method for class 'FCDCM'
update(object, ...)

## S3 method for class 'FCGDINA'
update(object, ...)

## S3 method for class 'FCGGUM'
update(object, ...)

## S3 method for class 'TIRT'
update(object, ...)

Arguments

object

An object of one of the following classes:

  • "MIRT" — Multidimensional IRT model.

  • "MGPCM" — Multidimensional Generalized Partial Credit Model.

  • "MGGUM" — Multidimensional Generalized Graded Unfolding Model.

  • "FCMIRT" — Forced-Choice Multidimensional IRT model.

  • "FCDCM" — Forced-Choice Diagnostic Classification Model.

  • "FCGDINA" — Forced-Choice GDINA model.

  • "FCGGUM" — Forced-Choice Generalized Graded Unfolding Model.

  • "TIRT" — Thurstonian IRT for Forced-Choice.

...

Additional named arguments passed to override or extend the original call. Valid arguments depend on the class of object and correspond to the formal parameters of the matching fit.*() function. Common overrides include method, control.model, control.method, and legacy control.

Details

Internally, each method extracts the stored arguments list from the input object, merges it with user-provided ... using modifyList, explicitly merges control lists from the previous fit and the update call, filters to only the formal parameters of the target fit.*() function, then re-invokes the fitting function via do.call.

This ensures that:

  • Only explicitly overridden parameters are changed.

  • Default values from the original call remain intact.

  • Complex nested structures (e.g., control.model, control.method, and control lists) can be partially updated.

  • Internal arguments (e.g., cores, vis, seed) are passed through to the method controls.

Value

An object of the same class as object, re-fitted using the original arguments updated with any provided in .... All unchanged parameters are preserved from the original call.

Methods (by class)

  • update(MIRT): Update method for MIRT objects. Re-fits the MIRT model with modified arguments. Supports changing model (e.g., m2pl -> m3pl), method (iStEM -> Stan), D, Q.matrix, control.model, and control.method.

  • update(MGPCM): Update method for MGPCM objects. Re-fits the MGPCM model with modified arguments.

  • update(MGGUM): Update method for MGGUM objects. Re-fits the MGGUM model with modified arguments.

  • update(FCMIRT): Update method for FCMIRT objects. Re-fits the FCMIRT model with modified arguments. Supports changing model, method, fc.type, block.items, and control settings.

  • update(FCDCM): Update method for FCDCM objects. Re-fits the FCDCM model with modified arguments. Supports changing dcm.type, method, block.items, and control settings.

  • update(FCGDINA): Update method for FCGDINA objects. Re-fits the FCGDINA model with modified arguments.

  • update(FCGGUM): Update method for FCGGUM objects. Re-fits the FCGGUM model with modified arguments.

  • update(TIRT): Update method for TIRT objects. Re-fits the TIRT model with modified arguments. Supports changing fc.type, method, pairs.value, and control settings.

Examples

sim <- sim.data.MIRT(N = 20, I = 6, D = 2, model = "m2pl")
fit <- fit.MIRT(sim$response, model = "m2pl", D = 2, method = "iStEM",
                control.method = list(
                  vis = FALSE, seed = 123,
                  M = 2, B = 2, burnin.maxitr = 2,
                  maxitr = 3, eps1 = 10, eps2 = 10,
                  estimate.se = FALSE))


# stan code, long time
# Switch to Stan estimation with more chains
fit_stan <- update(fit, method = "stan",
                   control.method = list(chains = 1, iter = 200))


# Change model to 3PL
fit_3pl <- update(fit, model = "m3pl")

# Adjust prior hyperparameters
fit_prior <- update(fit, control.model = list(a.mu = 0.5, a.sigma = 0.5))


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