% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/MeanimileEstimator.R
\name{MeanimileEstimator}
\alias{MeanimileEstimator}
\title{Estimate a univariate meanimile}
\usage{
MeanimileEstimator(
  d_tau,
  tau,
  lossDerivative,
  delta = NULL,
  sample,
  grid_size = 1000
)
}
\arguments{
\item{d_tau}{A function representing the density function of the
distributional weight function D_tau.}

\item{tau}{A numeric risk level/index (e.g., 0.95).
Argument of d_tau function.}

\item{lossDerivative}{Function defining the derivative of the loss function.}

\item{delta}{Optional numeric parameter for the loss function (default:\code{NULL}).}

\item{sample}{A numeric vector of univariate data.}

\item{grid_size}{An integer defining the resolution of the fallback grid
(default: 1000).}
}
\value{
A numeric scalar representing the estimated meanimile.
}
\description{
Calculates the empirical meanimile for a given (univariate) data sample,
weight function, and loss derivative.
}
\examples{
set.seed(123)
x <- rnorm(100)
d_tau_expectile <- function(u, tau) {
  1
}
lossDerivativeExpectiles <- function(x, c, delta) {
  -2 * ifelse(x > c, delta, 1 - delta) * (x - c)
}
MeanimileEstimator(d_tau_expectile, tau = 0, lossDerivativeExpectiles,
    delta = 0.95, sample = x)

}
\references{
D. Debrauwer, I. Gijbels, and K. Herrmann. (2026)
On a general class of functionals: Statistical inference and
application to risk measures
Electronic Journal of Statistics
doi:https://doi.org/10.1214/25-EJS2391
}
