% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/residual_entropy.R
\name{residual_entropy}
\alias{residual_entropy}
\title{Residual Entropy Function}
\usage{
residual_entropy(dens_fn, surv_fn = NULL, t = 0, upper = 100)
}
\arguments{
\item{dens_fn}{Density function \eqn{f(x)}.}

\item{surv_fn}{Survival function \eqn{\bar{F}(x)}; if \code{NULL} it is
computed from \code{dens_fn} by integration.}

\item{t}{Truncation time (default 0, which returns Shannon entropy).}

\item{upper}{Upper integration limit.}
}
\value{
Scalar numeric.
}
\description{
Computes the residual entropy (dynamic entropy) introduced by Ebrahimi and
Pellerey (1995):
\deqn{H(X; t) = -\int_t^\infty \frac{f(x)}{\bar{F}(t)}
  \log\frac{f(x)}{\bar{F}(t)}\,dx, \quad t \ge 0.}
}
\examples{
# Exponential(1)
f  <- function(x) dexp(x, 1)
Fb <- function(x) pexp(x, 1, lower.tail = FALSE)
residual_entropy(f, Fb, t = 0)   # = 1
residual_entropy(f, Fb, t = 1)   # = 1 + exp(-1) * log(exp(1)-1) or similar

}
\references{
Ebrahimi N., Pellerey F. (1995). New partial ordering of survival functions
based on the notion of uncertainty. *Journal of Applied Probability*, 32(1),
202--211.
}
\seealso{
\code{\link{residual_info_gen}}, \code{\link{shannon_entropy}}
}
