% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simulate.R
\name{sim_metad_participant}
\alias{sim_metad_participant}
\title{Simulate from the hierarchical meta-d' model}
\usage{
sim_metad_participant(
  N_participants = 100,
  N_trials = 100,
  mu_dprime = 1,
  sd_dprime = 0.5,
  mu_c = 0,
  sd_c = 0.5,
  mu_log_M = 0,
  sd_log_M = 0.5,
  mu_z_c2_0 = rep(-1, 3),
  sd_z_c2_0 = rep(0.1, 3),
  r_z_c2_0 = diag(3),
  mu_z_c2_1 = rep(-1, 3),
  sd_z_c2_1 = rep(0.1, 3),
  r_z_c2_1 = diag(3),
  metac_absolute = TRUE,
  summarize = FALSE,
  lcdf = normal_lcdf,
  lccdf = normal_lccdf
)
}
\arguments{
\item{N_trials, N_participants}{Total number of participants and trials to
simulate per participant. Half of these trials will have \code{stimulus=0} and
half will have \code{stimulus=1}.}

\item{mu_dprime, sd_dprime}{The mean and standard deviation of sensitivities
of the signal detection agents to simulate}

\item{mu_c, sd_c}{The mean and standard deviation of response bias of the
signal detection agents to simulate}

\item{mu_log_M, sd_log_M}{The mean and standard deviation of metacognitive
efficiency of the agents on the logarithmic scale, where \code{0} indicates
optimal metacognitive sensitivity, negative numbers indicate metacognitive
inefficiency, and positive numbers indicate metacognitive hyper-efficiency.}

\item{mu_z_c2_0, mu_z_c2_1}{Mean distance between confidence thresholds for
\code{"0"} and \code{"1"} responses on the log_scale, such that \code{meta_c2_0 = meta_c - cumulative_sum(exp(z_c2_0))} and \code{meta_c2_1 = meta_c + cumulative_sum(exp(z_c2_1))}.}

\item{sd_z_c2_0, sd_z_c2_1}{SD of log distances between confidence thresholds
for \code{"0"} and \code{"1"} responses on the log_scale.}

\item{r_z_c2_0, r_z_c2_1}{Correlation of log distances between confidence thresholds
for \code{"0"} and \code{"1"} responses on the log_scale.}

\item{metac_absolute}{Determines how to fix the type 1 threshold for modeling
confidence ratings. If metac_absolute=TRUE, \code{meta_c = c}. Otherwise,
\code{meta_c = M * c}.}

\item{summarize}{Aggregate the data? If summarize=FALSE, returns a dataset
with one row per observation. If summarize=TRUE, returns an aggregated
dataset where \code{n} is the number of observations per response, accuracy, and
confidence level.}

\item{lcdf}{The log cumulative distribution function of the underlying signal
distribution. By default, uses a \verb{normal(+/-dprime/2, 1)} distribution.}

\item{lccdf}{The log complement cumulative distribution function of the
underlying signal distribution. By default, uses a \verb{normal(+/-dprime/2, 1)}
distribution.}
}
\value{
A simulated dataset of type 1 responses and confidence ratings, with
columns:
\itemize{
\item \code{trial}: the simulated trial number
\item \code{participant}: the simulated participant number
\item \code{stimulus}: the value of the stimulus on each trial (either \code{0} or \code{1})
\item \code{response}: the simulated type 1 response (either \code{0} or \code{1})
\item \code{correct}: whether \code{stimulus==response} (either \code{0} or \code{1})
\item \code{confidence}: the simulated type 2 response (from \code{1} to \code{length(c2_0_diff)+1})
\item \code{dprime:theta_2}: the simulated agent's parameter values
}

If \code{summarize=TRUE}, the \code{trial} column is replaced with an \code{n} column
indicating the number of simulated type 1/type 2 responses for each
possible value.
}
\description{
Generate a simulated dataset across participants from the
meta-d' model with sensitivity \code{dprime}, response bias \code{c}, metacognitive
efficiency \code{log_M}, and distances between confidence thresholds \code{c2_0_diff}
and \code{c2_1_diff} (for the two responses).
}
\examples{
sim_metad_participant(N_participants = 10, N_trials = 10)
sim_metad_participant(N_participants = 25, mu_dprime = 2, mu_log_M = -1)
}
