% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pheno_trend_turning.R
\name{mann_kendall_z}
\alias{mann_kendall_z}
\title{Mann-Kendall Z-Statistic}
\usage{
mann_kendall_z(x)
}
\arguments{
\item{x}{Numeric vector (time series assumed to be equidistant).
\code{NA} values are silently removed.}
}
\value{
Numeric. The Mann-Kendall Z-statistic. Positive values indicate an
increasing trend, negative values decreasing. Compare against standard
normal quantiles (e.g., \code{|Z| > 1.96} for \code{p < 0.05}).
Returns \code{NA} if fewer than three non-missing values.
}
\description{
Computes the Mann-Kendall Z-statistic for a time series, a non-parametric
test of monotonic trend. The Z-statistic is approximately standard normal
under the no-trend null hypothesis.
}
\details{
The implementation uses the standard tie correction for \code{Var(S)} (so
that tied observations do not inflate the test) and the continuity
correction \code{Z = (S - sign(S))/sqrt(Var(S))}, matching
\code{Kendall::MannKendall()}.
}
\section{Note on \code{kendall_tau()}}{

Earlier versions of pep725 exported a function called \code{kendall_tau()}
that actually returned this Mann-Kendall Z-statistic (not the true
Kendall's \eqn{\tau} = \eqn{S / (n(n-1)/2)}). \code{kendall_tau()} is now
a deprecated alias of \code{mann_kendall_z()}; please update callers.
}

\examples{
# Decreasing trend (earlier phenology)
mann_kendall_z(c(120, 118, 115, 112, 110, 108, 105))

# No clear trend
mann_kendall_z(c(120, 115, 122, 118, 121, 116, 119))

}
\references{
Mann, H.B. (1945). Nonparametric tests against trend. \emph{Econometrica}
13, 245-259.

Kendall, M.G. (1975). \emph{Rank Correlation Methods}. 4th ed. London:
Charles Griffin.
}
\seealso{
\code{\link{kendall_tau}} (deprecated alias);
\code{\link{pheno_trend_turning}} for a full sequential Mann-Kendall
analysis.
}
\author{
Matthias Templ
}
