% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/predictable_bounds.R
\name{eprocess_predictable}
\alias{eprocess_predictable}
\title{Fixed-lambda e-process with predictable bounds (Proposition 7)}
\usage{
eprocess_predictable(
  scores1,
  scores2,
  c_seq,
  lambda = NULL,
  alpha = 0.05,
  gammas = NULL,
  clip_max = 1e+07,
  strict = FALSE
)
}
\arguments{
\item{scores1}{Numeric vector. Scores for forecaster 1.}

\item{scores2}{Numeric vector. Scores for forecaster 2.}

\item{c_seq}{Numeric vector. Predictable bound sequence (c_i), same
length as scores1. Must satisfy \verb{|scores1[i]-scores2[i]| <= c_i/2}
and c_i > 0 for all i.}

\item{lambda}{Numeric in \verb{[0, 1/c_0)}. Betting parameter. Must be
strictly less than 1/c_0 where c_0 = max(c_seq).
If NULL, uses the recommended default lambda = 0.5/c_0.}

\item{alpha}{Numeric in (0,1). Significance level for rejection rule.
Default: 0.05. Not used in computation, only for API
consistency. Pass the same value to \code{\link[=predictable_rejections]{predictable_rejections()}}
when evaluating rejection.}

\item{gammas}{Numeric vector or NULL. Predictable centering sequence.
If NULL, constructed as lagged running mean.}

\item{clip_max}{Numeric. Maximum e-process value. Default: 1e7.}

\item{strict}{Logical. If TRUE, any violation of the bound condition at
any time point will stop execution with an error. If FALSE
(default), a warning is issued but the e-process is still computed.
Note that violations invalidate the e-process guarantee,
so strict = TRUE is recommended for formal inference.}
}
\value{
data.frame with columns:
t, e_pq, e_qp, log_e_pq, log_e_qp, c_seq, lambda_used
}
\description{
Constructs a valid e-process when score difference bounds vary over time
but are predictable (known at time i-1 before observing hat_delta_i).
}
\details{
The e-process is computed as:
\deqn{\log E_t(\lambda) = \sum_{i=1}^t \Bigl[\lambda\,\hat{\delta}_i
        - \psi_{E,c_i}(\lambda)\,(\hat{\delta}_i - \gamma_i)^2\Bigr]}

where
\deqn{\psi_{E,c}(\lambda) = \frac{-\log(1 - c\lambda) - c\lambda}{c^2}}
is evaluated at each step with the current \eqn{c_i}.

LAMBDA CHOICE: lambda = 0.5/c_0 is a conservative default that stays
well within the valid domain \verb{[0, 1/c_0)}. For better power, lambda can
be tuned to the expected signal size, but must never reach 1/c_0.

VALIDITY CHECK: The function verifies |hat_delta_i| <= c_i/2 at each
step and warns if violated. Violations invalidate the e-process guarantee.
}
\section{Predictability}{

The bound sequence \code{c_seq} (and the centering sequence \code{gammas}) must be
predictable: \code{c_i} is fixed and known at time \code{i - 1}, before
\code{scores1[i]}/\code{scores2[i]} (and hence \code{hat_delta_i}) are observed —
formally, \eqn{c_i} is \eqn{\mathcal{F}_{i-1}}-measurable. A bound chosen
after seeing \code{hat_delta_i} (e.g. derived from the realised data range)
invalidates the e-process guarantee, even if it numerically satisfies
\verb{|hat_delta_i| <= c_i/2}.
}

\examples{
scores1 <- c(0.10, 0.20, 0.15, 0.25)
scores2 <- c(0.05, 0.10, 0.10, 0.20)
c_seq <- rep(1, length(scores1))
ep <- eprocess_predictable(scores1, scores2, c_seq = c_seq)
head(ep)

}
