Repository navigation
WIP: abstraction/namespace correction for IRF - #5206
jbrockmendel wants to merge 1 commit into
Conversation
|
needs careful review |
Definitely not. The initial motivation was in trying to shore up the unit tests. I think there's just a couple of smoke tests in test_var.
Thoughts on how to proceed? My inclination would be to split this into bite-size logically-independent steps. That approach isn't everyone's cup of tea. |
|
The first step for this kind of refactoring is adding unit tests to ensure we don't have refactoring bugs in uncovered code. It's better to keep structural changes, e.g. moving several methods across classes, together. The first step is to decide whether the basic idea for the restructuring makes sense and is worth the effort, taking eg. deprecation cost into account. In general, i.e. without having looked at the details of the changes here: |
uh, maybe software-development-process is not the best topic for the two of us
Yah, total tangent but Closing until after #5220. |
IRF needs some TLC. This PR is intended to discuss what order things should be done in.
var_model
The
VARProcessclass represents a known VAR process, takescoefsandsigma_u. This is a very good abstraction, is mathematically/statistically meaningful. To make it more directly usable, methods/properties ofVARResultsthat correspond to to this abstraction should be moved up to this class. Demonstrated in this PR byroots,_cov_sigma,cov_ybar.Also for demonstration purposes this collected all the coefs-but-not-sigma_u properties/methods first, as those also form a meaningful abstraction.
vector_ar.irf
irf has a BaseIRAnalysis and IRAnalysis(BaseIRAnalysis). BaseIRAnalysis uses some methods that are only defined in IRAnalysis (NameError, not just NotImplementedError). If those methods were moved to IRAnalysis, there would be basically nothing left in the base class. I think we're better off just having the one class. Is there either a) a meaningful abstraction the base class represents or b) something else we anticipate subclassing it?
The signature is incorrect as is. both
__init__methods takemodel, but what they really need isresultsorprocess.The
Tattribute is easy to confuse with transpose when reading. Better to keep it consistent with the parent object'snobs. Usinglagsinstead ofk_ardoesn't have the same confusion issue, but we might as well keep it internally consisnent.