linearmodels.iv.model.IVGMMCUE.predict

IVGMMCUE.predict(params: ndarray | DataArray | DataFrame | Series | list[Any] | tuple[Any, ...], *, exog: IVData | ndarray | DataArray | DataFrame | Series | list[Any] | tuple[Any, ...] | None = None, endog: IVData | ndarray | DataArray | DataFrame | Series | list[Any] | tuple[Any, ...] | None = None, data: DataFrame | None = None, eval_env: int = 2) → DataFrame

Predict values for additional data.

Parameters:
params: ndarray | DataArray | DataFrame | Series | list[Any] | tuple[Any, ...]

Model parameters (nvar by 1).

exog: IVData | ndarray | DataArray | DataFrame | Series | list[Any] | tuple[Any, ...] | None = None

Exogenous regressors (nobs by nexog).

endog: IVData | ndarray | DataArray | DataFrame | Series | list[Any] | tuple[Any, ...] | None = None

Endogenous regressors (nobs by nendog).

data: DataFrame | None = None

Values to use when making predictions from a model constructed from a formula.

eval_env: int = 2

Depth of the stack frame whose variables are used when evaluating the formula, counted from the formula parser. The default is 2, which is the frame that calls predict.

Returns:

Fitted values from supplied data and parameters.

Return type:

pandas.DataFrame

Raises:

ValueError – If data is used and the model was not created using a formula, if data is used with exog or endog, if none of exog, endog and data is provided, or if exog and endog have different numbers of rows.

Warns:

IndexWarning – If the indices of exog and endog do not match. The index of exog is used.

Notes

The number of parameters must satisfy nvar = nexog + nendog.

When using exog and endog, regressor matrix is constructed as [exog, endog] and so parameters must be aligned to this structure. This is the same structure used in model estimation.

If data is not none, then exog and endog must be none. Predictions from models constructed using formulas can be computed using either exog and endog, which will treat these are arrays of values corresponding to the formula-processed data, or using data which will be processed using the formula used to construct the values corresponding to the original model specification.