% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/stochastic_orders.R
\name{blt_order_residual}
\alias{blt_order_residual}
\title{Bivariate Laplace Transform Order of Residual Lives (BLt-rl)}
\usage{
blt_order_residual(
  surv_X,
  surv_Y,
  s1 = 1,
  s2 = 1,
  t1_grid = seq(0.1, 3, by = 0.5),
  t2_grid = seq(0.1, 3, by = 0.5),
  tol = 1e-06
)
}
\arguments{
\item{surv_X, surv_Y}{Joint survival functions for \eqn{X} and \eqn{Y}
respectively, each of the form \code{function(x1, x2)}.}

\item{s1, s2}{Laplace parameters to evaluate at.}

\item{t1_grid, t2_grid}{Grids of truncation times (default 0.1 to 3).}

\item{tol}{Tolerance for declaring inequality (default \code{1e-6}).}
}
\value{
A list with elements:
  \describe{
    \item{\code{order_holds}}{Logical; \code{TRUE} if \eqn{X \le Y} at all
      grid points.}
    \item{\code{violations}}{Data frame of grid points where the ordering
      fails.}
    \item{\code{ratio_matrix}}{Matrix of \eqn{L^*_X / L^*_Y} values.}
  }
}
\description{
Checks whether random vector \eqn{X} is smaller than \eqn{Y} in the
bivariate Laplace transform order of residual lives (BLt-rl).

\eqn{X \le_{\rm BLt\text{-}rl} Y} if and only if for all
\eqn{(t_1,t_2)} in the support:
\deqn{\frac{\int_{t_1}^\infty e^{-s_1 x_1}\bar{F}_X(x_1,t_2)\,dx_1}{
  e^{-s_1 t_1}\bar{F}_X(t_1,t_2)}
  \ge
  \frac{\int_{t_1}^\infty e^{-s_1 x_1}\bar{F}_Y(x_1,t_2)\,dx_1}{
  e^{-s_1 t_1}\bar{F}_Y(t_1,t_2)}}
i.e.\ \eqn{L^*_{X_{t_1|t_2}}(s_1) \ge L^*_{Y_{t_1|t_2}}(s_1)} for all
\eqn{t_1,t_2,s_1}.  The function evaluates this inequality at a grid.
}
\examples{
# Compare two Gumbel distributions
sX <- function(x1, x2) sgumbel_biv(x1, x2, k1 = 1, k2 = 1, theta = 0.2)
sY <- function(x1, x2) sgumbel_biv(x1, x2, k1 = 2, k2 = 2, theta = 0.2)
blt_order_residual(sX, sY, s1 = 1, s2 = 1,
                   t1_grid = c(0.1, 0.5, 1), t2_grid = c(0.1, 0.5))

}
\references{
Jayalekshmi S., Rajesh G., Nair N.U. (2022), Definition 4.1 & Prop. 4.1.
\doi{10.1080/03610926.2022.2085874}
}
\seealso{
\code{\link{blt_residual}}, \code{\link{biv_whr_order}}
}
