% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/logLikelihood_1.R
\name{logLikelihood_1}
\alias{logLikelihood_1}
\title{Log-Likelihood Contribution for Cause 1}
\usage{
logLikelihood_1(status, M, W)
}
\arguments{
\item{status}{A numeric vector indicating the event type:
\code{0} for censored, \code{1} for cause 1, \code{2} for other causes.}

\item{M}{A numeric matrix (usually computed with \code{\link{compute_M_optimized}}), representing
IPCW weights between individuals.}

\item{W}{A sparse matrix (e.g., of class \code{dgCMatrix} from the \pkg{Matrix} package)
representing estimated weights or hazards.}
}
\value{
A numeric scalar: the log-likelihood contribution from all individuals who failed from cause 1.
}
\description{
Computes the contribution to the log-likelihood from individuals who experienced event type 1,
using a weighting matrix \code{W} and an IPCW matrix \code{M}.
}
\details{
For each individual \code{i} such that \code{status[i] == 1}, the function computes:
\deqn{
\log W_{ii} - \log\left(\sum_j M_{ij} W_{ij}\right)
}
and sums this across all such individuals.
}
\seealso{
\code{\link[=compute_M_optimized]{compute_M_optimized()}}, \link[Matrix:Matrix-class]{Matrix::Matrix}
}
