% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/smsncut.R
\name{smsn_fit}
\alias{smsn_fit}
\title{Fit an SMSN model by maximum likelihood}
\usage{
smsn_fit(x, family = c("SN", "ST"), maxit = 4000L, reltol = 1e-10)
}
\arguments{
\item{x}{Numeric vector of observations. Non-finite values are removed.}

\item{family}{Character string, either \code{"SN"} (default) or \code{"ST"}.}

\item{maxit}{Integer. Maximum number of iterations for \code{optim}.
Default 4000.}

\item{reltol}{Numeric. Relative convergence tolerance. Default \code{1e-10}.}
}
\value{
A list with components:
  \item{par}{MLE in unconstrained parametrisation \eqn{\theta}.}
  \item{hessian}{Hessian of the negative log-likelihood at the MLE,
    computed by Richardson extrapolation.}
  \item{logLik}{Maximised log-likelihood.}
  \item{family}{Fitted family (\code{"SN"} or \code{"ST"}).}
  \item{convergence}{Convergence code from \code{optim} (0 = success).}
}
\description{
Fits a skew-normal (SN) or skew-t (ST) distribution to a univariate
sample by maximising the log-likelihood, using the unconstrained
parametrisation \eqn{\theta = (\xi, \log\omega, \alpha)} for SN or
\eqn{\theta = (\xi, \log\omega, \alpha, \log(\nu-2))} for ST.
}
\details{
The observed Fisher information matrix is computed via Richardson
extrapolation as implemented in \code{numDeriv::hessian()}, which is
critical for the reliability of the plug-in variance estimator
\eqn{\hat{V}} in heavy-tailed models (de Paula et al., 2026, Section 6.2).
}
\examples{
set.seed(1)
x <- sn::rsn(200, xi = 0, omega = 1, alpha = 2)
fit <- smsn_fit(x, family = "SN")
fit$par
fit$convergence
}
\references{
de Paula, R., Mouriño, H., and Dias Domingues, T. (2026).
Parametric ROC analysis and optimal cutoff selection under scale mixtures
of skew-normal distributions: a decision-theoretic framework with
asymptotic inference. \emph{arXiv:2605.07829}.
\doi{10.48550/arXiv.2605.07829}.
}
