% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/multiagent.R
\name{compute_hazard_surface}
\alias{compute_hazard_surface}
\title{Compute the full hazard surface over all directed dyads}
\usage{
compute_hazard_surface(history, base_riskset, beta, covariates = NULL)
}
\arguments{
\item{history}{Data frame of past events (columns: time, sender,
receiver, eveid).}

\item{base_riskset}{Precomputed base risk set (output of \code{get_base_riskset()}).}

\item{beta}{Named numeric vector of REM coefficients (from
\code{coef(rem_fit)}).}

\item{covariates}{Optional exogenous covariate list from \code{\link[=rem_covariates]{rem_covariates()}}.}
}
\value{
Data frame with columns \code{sender}, \code{receiver}, \code{hazard}.
}
\description{
Evaluates \code{exp(beta^T * x_ij)} for every directed dyad given the current
event history. Used internally by \code{\link[=run_multiagent_rem]{run_multiagent_rem()}} to derive sender
activation probabilities and the REM-hazard fallback for failed LLM parses.
}
\examples{
data(edgelist)
el   <- prepare_edgelist(edgelist)
fit  <- fit_rem(el[1:100, ],
  survival::Surv(time1, occurred) ~ Repetition + survival::strata(time2),
  n_nonevents = 20L, method = "clogit")
nodes  <- sort(unique(c(el$sender, el$receiver)))
rs     <- expand.grid(sender = nodes, receiver = nodes)
rs     <- rs[rs$sender != rs$receiver, ]
rs$eid <- paste0(rs$sender, "_", rs$receiver)
beta <- c(Repetition = coef(fit)[["Repetition"]])
hz   <- compute_hazard_surface(el[1:5, ], rs, beta)
head(hz)
}
