% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mlmodel-utils.R, R/poisson-postestimation.R
\name{update.mlmodel}
\alias{update.mlmodel}
\alias{update.ml_poisson}
\title{Update an mlmodel Call}
\usage{
\method{update}{mlmodel}(
  object,
  formula. = NULL,
  scale. = NULL,
  data = NULL,
  weights = NULL,
  subset = NULL,
  ...,
  evaluate = TRUE
)

\method{update}{ml_poisson}(
  object,
  formula. = NULL,
  data = NULL,
  weights = NULL,
  subset = NULL,
  ...,
  evaluate = TRUE
)
}
\arguments{
\item{object}{An \code{mlmodel} object.}

\item{formula.}{An updated formula for the value (location/mean) equation.}

\item{scale.}{An updated formula for the scale equation (if supported by the model).}

\item{data}{A data frame to be used when re-fitting the model.}

\item{weights}{Optional case weights.}

\item{subset}{An expression or logical vector to subset, or a vector of indices
to resample (\code{sandwich} uses it for that).}

\item{...}{Further arguments passed to methods (currently ignored).}

\item{evaluate}{Logical. If \code{TRUE} (default), the updated call is evaluated
and the new fitted model is returned. If \code{FALSE}, the updated call
(as a language object) is returned without evaluation.}
}
\value{
And updated \code{mlmodel} object (or the class of the estimator that
extends it) with the modified formula/call and refitted parameters.
}
\description{
Update an mlmodel Call
}
\details{
This method re-evaluates the original model call after modifying selected
arguments. It is used internally by \code{IMtest()} and serves as a fallback
mechanism in bootstrap and jackknife variance estimation when a model-specific
implementation is not available.

\strong{\code{sandwich} package compatibility}

The functions \code{sandwich::vcovBS()} and \code{sandwich::vcovJK()} are supported
through this \code{update()} method. They produce numerically equivalent results
to our own \code{vcov(object, type = "boot")} and \code{vcov(object, type = "jack")}
when all bootstrap/jackknife replications converge, taking longer to compute
them.

\strong{Important difference}: When some replications fail to converge,
\code{sandwich} includes those failed iterations in the variance calculation,
while our \code{vcov()} implementation uses \strong{only successful replications}.
The latter is statistically more appropriate.

We therefore strongly recommend using the native \code{vcov()} methods provided
by \strong{mlmodels} for bootstrap and jackknife variance-covariance matrices.
}
