This function calculates residuals for objects of class HZIP
usingrandomized quantile residuals. The computation is performed efficiently
using C++ functions for predicting random effects and calculating
residuals.
Usage
# S3 method for HZIP
residuals(object, ...)
Value
A numeric vector of residuals with length equal to the total number
of observations in the dataset.
Arguments
object
An object of class HZIP, typically returned from hzip.
...
Additional arguments (not used).
Details
The function internally groups the data by individual (Ind), constructs
model matrices for both zero-inflation and count parts of the model, and then
calls the C++ functions predict_HZIP_cpp_vec and r_ij_cpp_vec
to efficiently compute the residuals. Random effects are integrated using
adaptive quadrature based on the supplied nodes and weights.