Skip to content

SMEP D: Rename endog and exog

josef-pkt edited this page Apr 28, 2013 · 1 revision

SMEP: Rename endog and exog

Status: Proposal

for discussion see https://github.com/statsmodels/statsmodels/issues/395

For a more specific proposal we need the list of all current variable names that contain endog and exog and have alternative names.

The minimal renaming would be just to change the names in the signature, but that still leaves users that access the endog and exog attributes with confusing names.

If or when we implement the name change, it will affect all models, and we need a plan for the the transition and the breaks in backwards compatibility. Searching for the words in the statsmodels/statsmodels source tree (in my working branch that includes several uncommitted files), finds about 3800 occurrences of exog and 2600 occurences of endog. A large number of these occurrences are in the tests, the big model modules have around 50 to 100 occurrences each. The sandbox contains about 500 of those endog and 900 of the exog.

If we do a large scale renaming, then all branches that have not been merged and do not work only on a new module are expected to have considerable merge conflicts.

Proposed renamings

conventions

  • 1d LHS -> y
  • 2d LHS -> Y
  • RHS -> X

Transition

  • Change arguments to y/Y and X for 0.5.0.
  • Make endog and exog properties that raise a warning for users to move to y and X. Remove endog and exog completely in 0.6.0.

data objects

  • endog -> y
  • exog -> X
  • orig_endog -> orig_y
  • orig_exog -> orig_X
  • endog_names -> y_names
  • exog_names -> X_names

linear_model

  • endog -> y
  • exog -> X
  • wendog -> whitened_y
  • wxexog -> whitened_X
  • pinv_wexog -> pinv_whitened_X
  • exog_Q -> X_Q_decomp
  • exog_R -> X_R_decomp
  • stochastic_exog -> stochastic_X

discrete_model

  • endog -> y (also Y for MNLogit)
  • exog -> X
  • atexog -> atX

robust_model

  • endog -> y
  • exog -> X

generalized_linear_model

  • endog -> y
  • exog -> X

arima_model

  • endog -> y
  • exog -> X (exog contains lagged y and exogenous variables)

ar_model

  • endog -> y

* exog -> X (lagged y, no ARX model here) (Already using y and X, need Y -> y, because 1d)

(s)var_model

  • y/endog -> Y (already has self.y but should by Y for 2d)
  • z -> X (lagged Y, no VARX available yet, but should be handled like ARMAX)

    z is never attached, so users never see this.

  • ys_lagged/endog_lagged -> X
Clone this wiki locally