Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggested Updates to PR #10

Open
wants to merge 7 commits into
base: base_fittedvalues
Choose a base branch
from

Conversation

jbrockmendel
Copy link

The removing of now-inherited methods is tentative, could use another pair of eyeballs (and CI).

The cleanups are only in code that is already touched by your PR, so shouldn't unduly affect the git history.

@jbrockmendel
Copy link
Author

I think some resid/fittedvalues methods in tsa may also be made redundant, am holding off on those for now.

@@ -973,10 +974,13 @@ def _predict(self, h=None, smoothing_level=None, smoothing_slope=None,
formatted = formatted.loc[included]

hwfit = HoltWintersResults(self, self.params, fittedfcast=fitted,
_fittedvalues=fitted[:-h - 1], fcastvalues=fitted[-h - 1:],
sse=sse, level=level, slope=slope, season=season, aic=aic,
fittedvalues=fitted[:-h - 1],
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK, this doesn't work
we cannot override a cached property by an attribute

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In __init__ this now explicitly sets self._fittedvalues = fittedvalues

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was skimming to fast.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this also resolve your comment above in __init__?

@@ -304,8 +304,9 @@ class HoltWintersResults(Results):
summary
"""

def __init__(self, model, params, **kwargs):
def __init__(self, model, params, fittedvalues=None, **kwargs):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this
in the standard pattern
fittedvalues should not be an explicit argument, because it should be a results cached attribute
in here it might be different because fittedvalues similar to statespace models is a byproduct of the estimation.

@josef-pkt
Copy link
Owner

overall it looks fine in quick skimming
I need to check some details more carefully, but expect that almost all can be merged and included.

@@ -1621,12 +1621,6 @@ class IVGMMResults(GMMResults):
def fittedvalues(self):
return self.model.predict(self.params)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can also go, but it isn't 100% obvious that this is equivalent to self.predict().

@jbrockmendel
Copy link
Author

@josef-pkt any more thoughts on this? I'm pretty stoked to see these tests fixed up.

Copy link
Owner

@josef-pkt josef-pkt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

partial review,
(I get distracted all the time and forget which chrome tab I'm supposed to be looking at.)

statsmodels/discrete/discrete_model.py Outdated Show resolved Hide resolved
statsmodels/discrete/tests/test_discrete.py Outdated Show resolved Hide resolved
statsmodels/regression/mixed_linear_model.py Outdated Show resolved Hide resolved
@josef-pkt
Copy link
Owner

main question now is whether I really want to add all this to my fittedvalues PR. I like a PR to stay focused on a specific issue, and minimal surrounding changes.

@jbrockmendel
Copy link
Author

updated with requested edits.

@jbrockmendel
Copy link
Author

Any thoughts?

@jbrockmendel
Copy link
Author

@josef-pkt wadaya say? it'd be nice to get this off my desktop

@jbrockmendel
Copy link
Author

@josef-pkt ping; any thoughts on this?

@jbrockmendel
Copy link
Author

Any chance of this going anywhere? Is there a subset that could go through quickly?

@jbrockmendel
Copy link
Author

@josef-pkt any thoughts on how to proceed here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants