% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/nw_tools.R
\name{nw_est_mom}
\alias{nw_est_mom}
\title{Method-of-moments estimation for the Normal-Wald distribution}
\usage{
nw_est_mom(
  data = NULL,
  stats = NULL,
  mu = NA,
  delta = NA,
  beta = NA,
  alpha = NA,
  triangle = FALSE,
  ...
)
}
\arguments{
\item{data}{Optional data vector. If supplied, empirical moments are computed
from \code{data} and \code{stats} is ignored.}

\item{stats}{Optional numeric vector of length 4 containing mean, variance,
skewness, and kurtosis. Entries may be \code{NA} when the corresponding
parameter is fixed.}

\item{mu}{Location parameter, if fixed.}

\item{delta}{Scale parameter, if fixed.}

\item{beta}{Skewness parameter, if fixed.}

\item{alpha}{Tail parameter, if fixed.}

\item{triangle}{Logical; if \code{TRUE}, return only the asymmetry and
steepness summary parameters.}

\item{...}{Additional arguments passed to \code{\link[stats]{optim}}.}
}
\value{
If \code{triangle = FALSE}, a named numeric vector with entries
\code{mu}, \code{delta}, \code{beta}, and \code{alpha}.
If \code{triangle = TRUE}, a named numeric vector with entries
\code{asymmetry} and \code{steepness}.
}
\description{
Estimates Normal-Wald parameters from sample moments or from a supplied
vector of moments.
}
\details{
This function computes method-of-moments estimates for the Normal-Wald
distribution. If \code{data} is supplied, sample mean, variance, skewness,
and kurtosis are computed automatically. Otherwise, the user may provide
these moments directly through \code{stats}.

If some parameters are fixed, only the remaining parameters are estimated.
When \code{triangle = TRUE}, the returned values are the transformed summary
quantities
\eqn{\text{steepness} = (1 + |\gamma|)^{-1/2}} and a corresponding
asymmetry measure.
}
\examples{
n <- 500
y <- rgamma(n, 3, 1.5) + rlnorm(n, 1, 0.5)
z <- (y - mean(y)) / sd(y)
skew <- mean(z^3)
kurt <- mean(z^4)

nw_est_mom(stats = c(NA, NA, skew, kurt), mu = 0, delta = 1, triangle = TRUE)
nw_est_mom(stats = c(NA, var(y), skew, kurt), mu = 0, triangle = TRUE)
}
