statsmodels.genmod.cov_struct.Autoregressive¶
-
class
statsmodels.genmod.cov_struct.
Autoregressive
(dist_func=None, grid=False)[source]¶ A first-order autoregressive working dependence structure.
The dependence is defined in terms of the time component of the parent GEE class, which defaults to the index position of each value within its cluster, based on the order of values in the input data set. Time represents a potentially multidimensional index from which distances between pairs of observations can be determined.
The correlation between two observations in the same cluster is dep_params^distance, where dep_params contains the (scalar) autocorrelation parameter to be estimated, and distance is the distance between the two observations, calculated from their corresponding time values. time is stored as an n_obs x k matrix, where k represents the number of dimensions in the time index.
The autocorrelation parameter is estimated using weighted nonlinear least squares, regressing each value within a cluster on each preceding value in the same cluster.
- Parameters
- dist_func
function
from
R^kx
R^kto
R^+,optional
A function that computes the distance between the two observations based on their time values.
- dist_func
References
B Rosner, A Munoz. Autoregressive modeling for the analysis of longitudinal data with unequally spaced examinations. Statistics in medicine. Vol 7, 59-71, 1988.
Methods
covariance_matrix
(endog_expval, index)Returns the working covariance or correlation matrix for a given cluster of data.
covariance_matrix_solve
(expval, index, …)Solves matrix equations of the form covmat * soln = rhs and returns the values of soln, where covmat is the covariance matrix represented by this class.
initialize
(model)Called by GEE, used by implementations that need additional setup prior to running fit.
summary
()Returns a text summary of the current estimate of the dependence structure.
update
(params)Update the association parameter values based on the current regression coefficients.
Methods
covariance_matrix
(endog_expval, index)Returns the working covariance or correlation matrix for a given cluster of data.
covariance_matrix_solve
(expval, index, …)Solves matrix equations of the form covmat * soln = rhs and returns the values of soln, where covmat is the covariance matrix represented by this class.
initialize
(model)Called by GEE, used by implementations that need additional setup prior to running fit.
summary
()Returns a text summary of the current estimate of the dependence structure.
update
(params)Update the association parameter values based on the current regression coefficients.