Skip to content

backdoors, fit new y #718

Open
Open

Description

@josef-pkt

we had a long thread about whether endog/Y should be in the __init__ or in the fit method.
https://groups.google.com/d/msg/pystatsmodels/Fkwoqbgmey8/c2F4CO0muRkJ

We didn't change the method where engog is given, because of too much working avoiding stale state, but we changed that pinv_wexog is cached.
I also added a section to the documentation about "stale" state in repeated calls to fit with different arguments.

During the first GSOC we had the discussion about creating instances (and whether it's cheap) and decided to create a new instance for each WLS iteration in GLM and RLM.

However with the wrapper and checking code in __init__, the instance creation is not so cheap anymore. (no actual timing)

Currently, Vincent is adding quantile regression with an inline iteratively reweighted least squares loop.
In GLSHet, I call the fit method repeatedly without creating new instances.

I think we should add a semi-official method for fitting with new y. (semi-official: public but add Warnings in docstring about proper use.), along the lines of this
https://groups.google.com/d/msg/pystatsmodels/Fkwoqbgmey8/zxjbXnc_n4kJ
and GLSHet, and GLSAR iterative loop.

Besides the nipy use case, which is actually multivariate or panel model, the main usecase would be parametric bootstrap.

(BTW: PanelAR1 should handle the nipy usecase in a vectorized way, but there might not be a way to estimate with fixed rho.
edit: No, it doesn't. It's not truly mulivariate endog with same exog, it either assumes different exog or/and identical parameters across panel-units.)

Activity

  1. added this to the 0.8 milestone on Sep 16, 2015
  2. josef-pkt commented on Sep 16, 2015

    @josef-pkt
    MemberAuthor

    bump for 0.8

    addition: add option to use existing model or create auxiliary model (clone)

    • the first is the nipy usecase of fitting many endog (essentially multivariate endog with parallel OLS/GLS)
    • the second case would be useful for bootstrap, where we have our original data and model, and we want an additional model for the residual bootstrap. (Watch out for recursion, we only want one additional model with the same exog.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions