% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fitting.R
\name{fitDist}
\alias{fitDist}
\title{Distribution fitting}
\usage{
fitDist(
  data,
  dist,
  n.points,
  norm,
  constrain,
  opts = list(algorithm = "NLOPT_LN_NELDERMEAD", xtol_rel = 1e-08, maxeval = 10000)
)
}
\arguments{
\item{data}{numeric vector of values to fit}

\item{dist}{character; distribution name (e.g. \code{"norm"}, \code{"ggamma"})}

\item{n.points}{integer; number of ECDF points used in norm computation}

\item{norm}{character; norm identifier — one of \code{"N1"} (ratio RMSE on
quantiles), \code{"N2"} (MSE on quantiles), \code{"N3"} (ratio RMSE on
probabilities), \code{"N4"} (MSE on probabilities)}

\item{constrain}{logical; if \code{TRUE}, constrains \code{shape2} parameters
to \code{(0, 0.48)} to enforce finite upper tails}

\item{opts}{list of \code{nloptr} minimisation options}
}
\value{
An object of class \code{"fitDist"}: a named list of fitted
distribution parameters with attributes \code{dist}, \code{edf} (empirical
CDF), and \code{nfo} (full \code{nloptr} output).
}
\description{
Fits a parametric distribution to data using the Nelder-Mead simplex
algorithm to minimise one of four fitting norms.
}
\examples{

x <- fitDist(rnorm(1000), "norm", 30, "N1", FALSE)
x

}
\seealso{
\code{\link{fitACS}}, \code{\link{plot.fitDist}}
}
