% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pmm3_main.R
\name{lm_pmm3}
\alias{lm_pmm3}
\title{PMM3: Fit linear model using Polynomial Maximization Method (S=3)}
\usage{
lm_pmm3(
  formula,
  data,
  max_iter = 100,
  tol = 1e-06,
  adaptive = FALSE,
  step_max = 5,
  na.action = na.fail,
  verbose = FALSE
)
}
\arguments{
\item{formula}{R formula for the model}

\item{data}{data.frame containing variables in the formula}

\item{max_iter}{integer: maximum number of NR iterations (default 100)}

\item{tol}{numeric: convergence tolerance (default 1e-6)}

\item{adaptive}{logical: re-estimate kappa each iteration (default FALSE)}

\item{step_max}{numeric: maximum NR step size (default 5.0)}

\item{na.action}{function for handling missing values (default na.fail)}

\item{verbose}{logical: print progress information (default FALSE)}
}
\value{
S4 object of class \code{PMM3fit}
}
\description{
Fits a linear model using PMM3, which is designed for symmetric
platykurtic error distributions. Uses a cubic stochastic polynomial
with Newton-Raphson solver.
}
\details{
The PMM3 algorithm works as follows:
\enumerate{
\item Fits OLS regression to obtain initial estimates
\item Computes central moments (m2, m4, m6) from OLS residuals
\item Checks symmetry: warns if |gamma3| > 0.3 (PMM2 may be more appropriate)
\item Computes moment ratio kappa = (m6 - 3\emph{m4}m2) / (m4 - 3*m2^2)
\item Iterates Newton-Raphson with score Z = X'(eps*(kappa - eps^2))
}

PMM3 achieves lower variance than OLS when errors are symmetric and
platykurtic (gamma4 < 0), with theoretical efficiency
g3 = 1 - gamma4^2 / (6 + 9*gamma4 + gamma6).
}
\examples{
set.seed(123)
n <- 100
x <- rnorm(n)
y <- 2 + 3 * x + runif(n, -sqrt(3), sqrt(3))
dat <- data.frame(y = y, x = x)

fit <- lm_pmm3(y ~ x, data = dat)
summary(fit)
}
