% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/signed_depth.R
\name{reference_curve}
\alias{reference_curve}
\title{Reference (Median) Curve}
\usage{
reference_curve(X, depth = NULL, ...)
}
\arguments{
\item{X}{Numeric matrix (\eqn{N \times M}) of curves.}

\item{depth}{Numeric vector of length \eqn{N} of pre-computed FM depth
values. If \code{NULL} (default), \code{\link{fm_depth}} is called
internally with \code{type = "tukey"}.}

\item{...}{Additional arguments forwarded to \code{\link{fm_depth}} when
\code{depth} is \code{NULL}.}
}
\value{
A numeric vector of length \eqn{M}.
}
\description{
Returns the curve (or average of curves) that attains the maximum
Fraiman-Muniz depth over the combined sample — the functional analogue
of the median.
}
\examples{
set.seed(1)
X <- matrix(rnorm(50 * 100), nrow = 50)
ref <- reference_curve(X)
plot(ref, type = "l", xlab = "t", ylab = "x(t)",
     main = "Reference (median) curve")

}
