Skip to content

Data

VARData — validated, immutable data container for VAR models.

VARData

Bases: BaseModel

Immutable, validated container for VAR estimation data.

Attributes:

Name Type Description
endog ndarray

Endogenous variable array of shape (T, n) where T >= 1 and n >= 2.

endog_names list[str]

Names for each endogenous variable.

exog ndarray | None

Optional exogenous variable array of shape (T, k).

exog_names list[str] | None

Names for each exogenous variable. Required if exog is provided.

index DatetimeIndex

DatetimeIndex of length T.

from_df(df, endog, exog=None) classmethod

Construct VARData from a pandas DataFrame.

Parameters:

Name Type Description Default
df DataFrame

DataFrame with a DatetimeIndex.

required
endog list[str]

Column names for endogenous variables.

required
exog list[str] | None

Column names for exogenous variables (optional).

None

Returns:

Type Description
Self

Validated VARData instance.