% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/trace_elimination.R
\name{trace_to_log_likelihood}
\alias{trace_to_log_likelihood}
\title{Create log-likelihood function from trace}
\usage{
trace_to_log_likelihood(
  trace,
  observed_times,
  reward_vector = NULL,
  granularity = 0L
)
}
\arguments{
\item{trace}{Trace object from record_elimination_trace()}

\item{observed_times}{Numeric vector of observed waiting times}

\item{reward_vector}{Optional numeric vector of rewards}

\item{granularity}{Integer granularity for PDF computation (default 0 = auto)}
}
\value{
Function that takes theta and returns log-likelihood
}
\description{
Creates a log-likelihood function for use with SVGD or other inference methods.
Uses exact phase-type PDF computation (Phase 4 feature).
}
\details{
The returned function computes the exact phase-type log-likelihood:
sum(log(PDF(t_i | theta))) over all observed times.
}
\examples{
\dontrun{
trace <- record_elimination_trace(graph, param_length = 1)
observed <- c(1.5, 2.3, 0.8, 1.2)
log_lik <- trace_to_log_likelihood(trace, observed)

# Use with optimization
theta <- c(2.0)
ll <- log_lik(theta)
}

}
