Skip to content

SUMM/ENH: get_prediction_xxx special, extended get_prediction methods #7899

Open

Description

@josef-pkt

We have no the underlying infrastructure with NonlinearDeltaCov to add special cases of prediction without much work.

  • get_prediction: in my current version this can handle any model.predict(which=...) (after one more bugfix). Aggregation weights are still missing.

other possibilities not supported by this

  • get_prediction_partial:
    • linear prediction for subset of exog, we only have predict partial in GAM, AFAIR (can be done already using t_test)
    • "eform" can be considered also as partial prediction, i.e. predict for each parameter (of mean function)
    • I have not seen a multi-column, multi-parameter version of eform yet. Does it make sense to have link of a subsum of linpred?
  • get_prediction_nonlinear:
    • This would be for user specified function (similar to Stata)
    • This would mainly be a predict wrapper for wald_nonlinear
    • It should include agg_weights and average=True option that _get_wald_nonlinear does not have. (useful for margeff, predicted ATE)
  • get_prediction_diff (or compare? e.g. also allow ratio) ENH compare prediction #2291
    • special case of get_prediction_nonlinear where user provides two sets of exog and we predict ("which"?) the difference.
    • Using margins for count and binary exog would be a special case (e.g. in first exog set everyone is male, in second set everyone is female)
    • possible extension: we use formula transformation for each exog set. This would automatically handle interaction effects and polynomials.
    • do we need paired versus independent (in analogy to t_test) see below for ATE
  • predict_at (I will not be working on this anytime soon, I guess)
    • automatic construction of predefined exog sets
    • currently get_margeff includes some of this
    • emmeans and lsmeans in other packages
    • The difficult part will be formula handling if we support terms (and interaction) and not just columns of exog. It's difficult to get the relevant information about how user/formula constructed the exog.
  • ...

Right now I'm mainly interested in whether to add get_prediction_nonlinear and/or get_prediction_diff

ATE, average treatment effect possible use case for get_prediction_diff

  • paired: we predict potential outcome for each observation, i.e. two sets of exog cover the same observations
  • unpaired/independent: comparing subset of exog populations, only relevant with average=True. Observations in two exog sets need not be the same, i.e. compare average prediction in population 2 with average prediction in population 1.

related nonlinear example: risk ratio in Logit: ratio of average prediction or average of ratio. #2215 #2619

Activity

  1. josef-pkt commented on Nov 23, 2021

    @josef-pkt
    MemberAuthor

    I think we should add a method for the transform in predict with formulas as a utility method for users to construct predict exog.
    I did something similar already in base._prediction_inference for reuse across functions.

  2. josef-pkt commented on Feb 10, 2022

    @josef-pkt
    MemberAuthor

    get_prediction_diff might be able to replicate regression adjustment method in TreatmentEffect. #8034

    full interaction term treatment * exog_other so all parameters are allowed to differ by treatment.
    i.e. block structure of exog (as in RAGMM moment conditions.

    with appropriate full sample exog in get_prediction we can compute POM, and get_prediction_diff could compute ATE.

  3. added
    topic-post_estim
    on Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    comp-basecomp-discretecomp-genmodtopic-post_estimtopic-predicttype-enh

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions