% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/helpers.R
\name{generate_data}
\alias{generate_data}
\alias{generate_loadings}
\alias{generate_noise}
\alias{discretize_to_grid}
\alias{get_distribution}
\title{Simulate Q-sort data}
\usage{
generate_data(
  N,
  J,
  K,
  noise_sd = 1,
  error_type = "normal",
  nu = 5,
  contam_prop = 0.1,
  contam_scale = 4,
  loading_type = "simple",
  primary_range = c(0.55, 0.85),
  cross_range = c(-0.15, 0.15),
  seed = NULL
)

generate_loadings(
  N,
  K,
  primary_range = c(0.55, 0.85),
  cross_range = c(-0.15, 0.15),
  type = "simple"
)

generate_noise(
  J,
  N,
  type = "normal",
  sd = 1,
  nu = 5,
  contam_prop = 0.1,
  contam_scale = 4
)

discretize_to_grid(Y_cont, distr)

get_distribution(J)
}
\arguments{
\item{N, J, K}{Numbers of participants, statements, and factors.}

\item{noise_sd}{Residual SD.}

\item{error_type}{One of \code{"normal"}, \code{"t"}, \code{"contaminated"}.}

\item{nu}{Degrees of freedom for \code{error_type = "t"}.}

\item{contam_prop, contam_scale}{Contamination rate and scale.}

\item{loading_type}{\code{"simple"} or \code{"complex"}.}

\item{primary_range, cross_range}{Uniform ranges for primary and
cross-loadings.}

\item{seed}{Optional RNG seed; restored on exit.}

\item{type}{For \code{generate_noise()}, one of \code{"normal"}, \code{"t"},
\code{"contaminated"}. For \code{generate_loadings()}, \code{"simple"} or
\code{"complex"}.}

\item{sd}{Residual SD for \code{generate_noise()}.}

\item{Y_cont}{Continuous scores (for \code{discretize_to_grid()}).}

\item{distr}{Integer forced-distribution counts.}
}
\value{
\code{generate_data()} returns a list with \code{Y}, \code{Lambda_true},
\code{F_true}, \code{distribution}, \code{N}, \code{J}, \code{K}. The component helpers
return their respective raw objects.
}
\description{
\code{generate_data()} is the top-level data-generating function used
by the package's simulation studies and tests. It builds a
loading matrix (\code{generate_loadings()}), factor scores, noise of the
chosen type (\code{generate_noise()}), and discretises the continuous
signal onto a forced Q-sort grid (\code{discretize_to_grid()}). See also
\code{get_distribution()} for the standard forced-distribution lookup.
}
