% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/residual_entropy.R
\name{np_residual_info_gen}
\alias{np_residual_info_gen}
\title{Nonparametric Estimator for the Residual Entropy Generating Function}
\usage{
np_residual_info_gen(x, alpha = 1, t = 0, bw = NULL)
}
\arguments{
\item{x}{Numeric vector; observed sample.}

\item{alpha}{Positive parameter (default 1).}

\item{t}{Truncation time (default 0).}

\item{bw}{Bandwidth for KDE; uses \code{\link[stats]{bw.nrd0}} if
\code{NULL}.}
}
\value{
Scalar numeric estimate of REGF.
}
\description{
Given a univariate sample \eqn{X_1,\ldots,X_n}, estimates the REGF using a
kernel density estimator for \eqn{f} and the empirical survival function for
\eqn{\bar{F}(t)}:
\deqn{\hat{\mathcal{I}}_\alpha(t)
  = \sum_{i:X_i > t} \frac{\hat{f}(X_i)^{\alpha - 1}}{(n\,\hat{F}_n(t))^\alpha}
  \cdot \frac{1}{n}}
where \eqn{\hat{f}} is a Gaussian kernel density estimator.
}
\examples{
set.seed(1)
x <- rexp(100, rate = 1)
np_residual_info_gen(x, alpha = 2, t = 0)

# Compare with true value
f  <- function(x) dexp(x, 1)
Fb <- function(x) pexp(x, 1, lower.tail = FALSE)
residual_info_gen(f, Fb, alpha = 2, t = 0)

}
\references{
Smitha S., Rajesh G., Jayalekshmi S. (2024), Section 4.
*Journal of the Indian Statistical Association*, 62(1), 81--93.
}
\seealso{
\code{\link{residual_info_gen}}, \code{\link{sim_regf}}
}
