% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/smoothing.R
\name{ma}
\alias{ma}
\title{Two-Sided Moving Average Smoothing}
\usage{
ma(x, n = 5, circular = FALSE)
}
\arguments{
\item{x}{Numeric vector to smooth.}

\item{n}{Integer. Total number of neighbors used in the moving average.
Must be >= 1.}

\item{circular}{Logical. If TRUE, the smoothing wraps around the ends.}
}
\value{
A numeric vector of the same length as \code{x} containing the smoothed
values. Endpoints may be \code{NA} if \code{circular = FALSE}.
}
\description{
Applies a simple two-sided moving average smoother to a numeric vector.
This is used throughout the scanCP pipeline for stabilizing detector
statistics and spacing curves.
}
\details{
This function is a thin wrapper around \code{stats::filter()} with a symmetric
moving average kernel. It is intentionally lightweight and dependency-free.
}
\examples{
x <- rnorm(100)
y <- ma(x, n = 5)

}
