% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/seir_simulate.R
\name{seir_simulate}
\alias{seir_simulate}
\title{Simulate a stochastic SEIR epidemic with latent OU transmission}
\usage{
seir_simulate(n_steps, kappa, sigma_psi, mu_psi, x0, fixed)
}
\arguments{
\item{n_steps}{Integer. Number of days to simulate.}

\item{kappa}{Positive numeric. OU mean-reversion speed.}

\item{sigma_psi}{Positive numeric. OU continuous-time volatility.}

\item{mu_psi}{Numeric. OU long-run mean of log-transmission.}

\item{x0}{Numeric vector of length 5: initial state
\eqn{(S_0, E_0, I_0, R_0, \Psi_0)}.}

\item{fixed}{Named list of fixed model parameters. Must contain:
\describe{
\item{eps}{Incubation rate \eqn{\epsilon} (1/mean incubation period).}
\item{gamma}{Recovery rate \eqn{\gamma} (1/mean infectious period).}
\item{delta}{Background mortality rate \eqn{\delta}.}
\item{b}{Birth rate \eqn{b} (usually equal to \eqn{\delta}).}
\item{q}{Case detection probability \eqn{q \in (0,1]}.}
\item{N}{Reference population size \eqn{N}.}
\item{sigma_comp}{Compartment diffusion coefficient \eqn{\sigma_\cdot}.}
}}
}
\value{
A data frame with \code{n_steps + 1} rows (day 0 to day \code{n_steps})
and columns: \code{day}, \code{S}, \code{E}, \code{I}, \code{R},
\code{Psi}, \code{beta} (\eqn{e^{\Psi_t}}), \code{obs} (simulated
observed daily counts drawn from a Poisson distribution with mean
\eqn{q \epsilon E_t}).
}
\description{
Generates a synthetic epidemic trajectory from the stochastic SEIR model
with exact Ornstein-Uhlenbeck log-transmission dynamics, as described in
Section 2 of Feng and Wang (2025).
}
\examples{
fixed <- list(eps = 1/5, gamma = 1/10, delta = 1/(70*365),
              b = 1/(70*365), q = 0.3, N = 1e6, sigma_comp = 0.01)
x0 <- c(S = 1e6 - 100, E = 50, I = 50, R = 0, Psi = log(0.25))
traj <- seir_simulate(n_steps = 200, kappa = 0.05, sigma_psi = 0.10,
                      mu_psi = log(0.25), x0 = x0, fixed = fixed)
plot(traj$day, traj$obs, type = "l", xlab = "Day",
     ylab = "Daily cases", main = "Simulated epidemic")
}
\references{
Feng, W. and Wang, W. (2025). Bayesian sequential inference for a stochastic SEIR model
with latent transmission dynamics. \emph{Preprint}.
}
