% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/df_gen.R
\name{df_gen}
\alias{df_gen}
\title{Simulate real-time probabilistic forecasts (paper designs)}
\usage{
df_gen(N, Ngame, type = c("OU", "BM"), a = 1, b = 0.27)
}
\arguments{
\item{N}{Number of interior time steps (grid has \code{N+1} points from 0 to 1).}

\item{Ngame}{Number of independent replicates (games).}

\item{type}{\code{"OU"} (default) or \code{"BM"} for the innovation process used in the
bivariate construction.}

\item{a, b}{Constants controlling the drift of the latent trajectory (see
replication code).}
}
\value{
A tibble with columns including \code{game}, \code{grid}, \code{Y}, \code{phat_A},
\code{phat_B}, and latent \code{W1}, \code{W2}, etc., in long format.
}
\description{
Generates replicated “games” and two competing forecast trajectories on a
uniform grid from 0 to 1, following the simulation constructions used in
Yeh, Rice, and Dubin (2022) (see \code{sanity_generator} / simulation scripts in
the replication repository). Ornstein–Uhlenbeck (\code{type = "OU"}) or Brownian
motion (\code{type = "BM"}) noise can drive the latent processes; outputs include
binary outcomes \code{Y} and forecast probabilities \code{phat_A}, \code{phat_B} suitable
for \code{\link[=calc_Z]{calc_Z()}}, \code{\link[=calc_eig]{calc_eig()}}, etc.
}
\details{
Requires the \strong{sde} package (Suggests) for Brownian paths.
}
\examples{
\donttest{
if (requireNamespace("sde", quietly = TRUE)) {
  d <- df_gen(N = 15L, Ngame = 12L)
  head(d)
}
}

}
\references{
Yeh, C.-K., Rice, G., & Dubin, J. A. (2022). \emph{The American Statistician},
\emph{76}, 214--223. \doi{10.1080/00031305.2021.1967781}

Preprint: \url{https://arxiv.org/abs/2010.00781}
}
