% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/negbin_helpers.R
\name{negbin_theta}
\alias{negbin_theta}
\title{Estimate Negative Binomial Shape Parameter}
\usage{
negbin_theta(y, mu, weights = 1, init = NULL)
}
\arguments{
\item{y}{Response vector.}

\item{mu}{Mean vector.}

\item{weights}{Observation weights (default 1).}

\item{init}{Optional initial value for \eqn{\theta}. If NULL, uses a
moment-based estimate.}
}
\value{
Scalar MLE of \eqn{\theta}.
}
\description{
Computes the profile MLE of the shape parameter \eqn{\theta} given
current mean estimates \eqn{\mu}.
}
\details{
Maximizes the profile log-likelihood over \eqn{\theta} via Brent's
method on \eqn{[10^{-4}, 10^4]}.
}
\examples{
set.seed(1234)
mu <- rep(5, 200)
y <- rnbinom(200, size = 3, mu = 5)
negbin_theta(y, mu)

}
