Skip to content

Improve consistency of model API #280

Open
@nalimilan

Description

@nalimilan

Our current StatisticalModel API is heavily inspired from R, adapted to match Julia rules (plus some improvements), but it is not really consistent (since R isn't either). Below is a summary of the situation. Names are considered OK if they are either a standard abbreviation, or are spelled in full (and the name is not too long).

Names consistent with R and OK: coef, nobs, deviance, confint, fitted, residuals, predict, aic, bic, aicc, r2/, adjr2, adjr², stderr

Names that do not exist in R and are OK: aicc, r2/, adjr2, adjr², stderr, nulldeviance

Names different from R for good reasons: dof, dof_residual (to avoid two-letter objects, limiting confusion with df = DataFrame(...))

Names not consistent with R for bad reasons, and proposed change:

  • loglikelihood -> loglik (shorter, relatively standard abbreviation, and consistent with R)
  • nullloglikelihood -> null_loglik (shorter and more readable; if changed, nulldeviance should be called null_deviance)

Names consistent with R which should be changed:

  • vcov -> cov
  • model_response -> response ("model" is redundant with multiple dispatch)

Name to add and which does not exist in R: params, param or parameters. The choice depends on whether we accept abbreviations, or prefer full names everywhere. Names which should be changed accordingly include potentially coef, loglikelihood/nullloglikelihood, nobs, adjr2/adjr², confint and dof.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions