% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/api-import.R
\name{import_mirt_fit}
\alias{import_mirt_fit}
\title{Import an \code{mirt} fit to an mfrmr-compatible bundle}
\usage{
import_mirt_fit(
  fit,
  model = c("RSM", "PCM", "GPCM"),
  item_facet = "Item",
  compute_fit = FALSE
)
}
\arguments{
\item{fit}{An object returned by \code{\link[mirt:mirt]{mirt::mirt()}} (a
\code{SingleGroupClass}).}

\item{model}{One of \code{"RSM"}, \code{"PCM"}, \code{"GPCM"}. The importer
does not infer the model from the mirt object; pass the model
that was estimated.}

\item{item_facet}{Name to assign to the item facet in the
imported bundle (default \code{"Item"}).}

\item{compute_fit}{Logical. When \code{TRUE}, run \code{\link[mirt:itemfit]{mirt::itemfit()}}
and \code{\link[mirt:personfit]{mirt::personfit()}} to populate Infit / Outfit / OutfitZSTD
columns on the returned facet tables, plus build a
measurement-side \code{mfrm_diagnostics} bundle consumable by
\code{summary()}, \code{plot.mfrm_fit()}, \code{plot_qc_dashboard()}, etc.
Default \code{FALSE} keeps the importer fast (skeleton only).}
}
\value{
An \code{mfrm_imported_fit} object. Slots:
\describe{
\item{\code{summary}}{Model / method / N / LogLik / AIC / BIC.}
\item{\code{facets$person}}{Person ID, Estimate, SE, Extreme, plus
Infit / Outfit / OutfitZSTD / Zh when \code{compute_fit = TRUE}.}
\item{\code{facets$others}}{Item-level estimates and slopes; with
\code{compute_fit = TRUE}, also Infit / Outfit / S_X2 / RMSEA / df
from \code{mirt::itemfit()}.}
\item{\code{steps}}{Per-item threshold parameters extracted from the
IRT parameterisation (\code{b1}, ..., \code{b(K-1)}).}
\item{\code{config}}{List with the resolved \code{model} and \code{item_facet}
used for the import; downstream plot and table helpers consult
this to dispatch correctly on the imported bundle.}
\item{\code{diagnostics}}{\code{mfrm_diagnostics}-shape bundle when
\code{compute_fit = TRUE}; \code{NULL} otherwise.}
\item{\code{source}}{Imported-from metadata.}
}
}
\description{
Extracts item, step, and person parameters from a \code{\link[mirt:mirt]{mirt::mirt()}}
fit and returns an \code{mfrm_imported_fit} object. The returned
object has the public slots \code{summary}, \code{facets$person},
\code{facets$others}, \code{steps}, \code{config}, and \code{source} that the mfrmr
plot and table helpers expect. With \code{compute_fit = TRUE} the
importer also runs \code{\link[mirt:itemfit]{mirt::itemfit()}} and \code{\link[mirt:personfit]{mirt::personfit()}} so
Infit / Outfit columns are populated, and synthesises a
\code{mfrm_diagnostics}-shape \code{diagnostics} slot consumable by
downstream plot helpers (Wright map, QC dashboard, etc.).
}
\section{Scope}{

Bundles bias / DIF / anchor / replay slots are explicitly not
populated; full bidirectional import / export is planned for a
future release.
}

\seealso{
\code{\link[=import_tam_fit]{import_tam_fit()}}, \code{\link[=import_erm_fit]{import_erm_fit()}}
}
