% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/weight_estimation.R
\name{coef.metahunt_weight_model}
\alias{coef.metahunt_weight_model}
\title{Extract coefficients from a MetaHunt weight model}
\usage{
\method{coef}{metahunt_weight_model}(object, ...)
}
\arguments{
\item{object}{A fitted \code{"metahunt_weight_model"} from \code{\link[=fit_weight_model]{fit_weight_model()}}.}

\item{...}{Passed through to \code{\link[stats:coef]{stats::coef()}}.}
}
\value{
The coefficient vector / matrix returned by
\code{DirichletReg::DirichReg()}'s \code{coef()} method (numeric vector or matrix
depending on the parametrisation used by the underlying fit).
}
\description{
Returns the regression coefficients from the underlying weight-model fit.
For the default \code{"dirichlet"} method this delegates to
\code{\link[DirichletReg:dirichreg]{DirichletReg::DirichReg()}}'s \code{coef()} method.
}
\examples{
\donttest{
set.seed(1)
m <- 60; K <- 3
W <- data.frame(w1 = rnorm(m), w2 = rnorm(m))
eta <- cbind(0.5 * W$w1, -0.3 * W$w2, rep(0, m))
pi_true <- exp(eta) / rowSums(exp(eta))
pi_hat <- pi_true + matrix(rnorm(m * K, sd = 0.01), m, K)
pi_hat <- pmax(pi_hat, 0); pi_hat <- pi_hat / rowSums(pi_hat)
model <- fit_weight_model(pi_hat, W)
coef(model)
}

}
