% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simulate.R
\name{sim_metad}
\alias{sim_metad}
\title{Simulate from the meta-d' model}
\usage{
sim_metad(
  N_trials = 100,
  dprime = 1,
  c = 0,
  log_M = 0,
  c2_0_diff = rep(0.5, 3),
  c2_1_diff = rep(0.5, 3),
  metac_absolute = TRUE,
  summarize = FALSE,
  lcdf = normal_lcdf,
  lccdf = normal_lccdf
)
}
\arguments{
\item{N_trials}{Total number of trials to simulate. Half of these trials will
have \code{stimulus=0} and half will have \code{stimulus=1}.}

\item{dprime}{The sensitivity of the signal detection agent to simulate}

\item{c}{The response bias of the signal detection agent to simulate}

\item{log_M}{The metacognitive efficiency of the agent on the logarithmic
scale, where \code{0} indicates optimal metacognitive sensitivity, negative
numbers indicate metacognitive inefficiency, and positive numbers indicate
metacognitive hyper-efficiency.}

\item{c2_0_diff, c2_1_diff}{Distances between confidence thresholds for \code{"0"}
and \code{"1"} responses, such that \code{meta_c2_0 = meta_c - cumsum(c2_0_diff)} and
\code{meta_c2_1 = meta_c + cumsum(c2_1_diff)}.}

\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?
\itemize{
\item If \code{FALSE}, returns a dataset with one row per observation.
\item If \code{summarize=TRUE}, returns an aggregated
dataset where \code{n} is the number of observations per response, accuracy, and
confidence level.
}}

\item{lcdf, 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{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 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(N_trials = 10)
sim_metad(N_trials = 10000, summarize = TRUE)
sim_metad(N_trials = 10, c2_0_diff = 1, c2_1_diff = 1)
}
