Skip to content

MAINT: wrap lm_robust instead of re-implementing - #5772

Closed
jbrockmendel wants to merge 1 commit into
statsmodels:masterfrom
jbrockmendel:diother
Closed

jbrockmendel wants to merge 1 commit into
statsmodels:masterfrom
jbrockmendel:diother

Conversation

@jbrockmendel

Copy link
Copy Markdown
Contributor

Updates docstring to accurately describe return values.

BTW the function that calls _lm_score appears to be inconsistent in what it returns, and in what it expects _lm_score to return.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.04%) to 84.851% when pulling 41c5ce2 on jbrockmendel:diother into c8cf0c9 on statsmodels:master.

@codecov

codecov Bot commented May 22, 2019 •

Copy link
Copy Markdown

Codecov Report

Merging #5772 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5772      +/-   ##
==========================================
+ Coverage   82.28%   82.29%   +<.01%     
==========================================
  Files         593      593              
  Lines       93622    93615       -7     
  Branches    10339    10337       -2     
==========================================
- Hits        77041    77038       -3     
+ Misses      14184    14183       -1     
+ Partials     2397     2394       -3
Impacted Files Coverage Δ
statsmodels/base/_parameter_inference.py 64.61% <100%> (+2.11%) ⬆️
statsmodels/stats/descriptivestats.py 24.34% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c8cf0c9...41c5ce2. Read the comment docs.

@josef-pkt

Copy link
Copy Markdown
Member

Don't touch this.
this is less than a year old and work in progress

@josef-pkt josef-pkt closed this May 22, 2019
@josef-pkt

Copy link
Copy Markdown
Member

meaning, I don't want to think now about why I made a copy of the function.

@jbrockmendel

Copy link
Copy Markdown
Contributor Author

Buddy, leave it open and look at it in a year like everything else.

@jbrockmendel

Copy link
Copy Markdown
Contributor Author

meaning, I don't want to think now about why I made a copy of the function.

Oh, I can answer that because the discussion came up before: it was because you wanted to avoid a circular import. But that's no longer an issue, AFAICT.

@josef-pkt

Copy link
Copy Markdown
Member

What changed that circular import is not an issue anymore? if it was

(I thought the circular import argument was for another function.)

I closed it so that Kevin is not tempted to merge it.

@jbrockmendel

Copy link
Copy Markdown
Contributor Author

What changed that circular import is not an issue anymore? if it was

I'm not convinced it was ever an issue, but #4905 (comment) you said that was why you copy/pasted instead of importing. I guess somehow you were concerned about it becoming a circular import at some point in the future (?).

But (and I'm not sure why I didn't point this out in that thread at the time) _diagnostic_other was imported right at the top of the file right from the start in #2096 until unused imports were removed.

Can you take a look at the two places where _lm_robust is used and double-check my speculation that signature-drift may be causing trouble? The call on L225 is hit in the test suite, but the call on L238 is not. If I'm reading it right, that will end up calling stats.chi.sf((lm_stat, pval, k_constraints), k_constraints) where you probably intended to use stats.chi.sf(lm_stat, k_constraints) (which is in fact already done in _lm_robust). stats.chi.sf will then return a 3-entry array, which I don't think is what you want here.

(Me being wrong here is the desired outcome)

@jbrockmendel

Copy link
Copy Markdown
Contributor Author

Besides the possible bug discussed in this thread, the thread itself makes the risk of Kevin merging it effectively zero, while the risk of it falling through the cracks is significant. Please re-open.

@josef-pkt

josef-pkt commented May 22, 2019 •

Copy link
Copy Markdown
Member

There is the open issue #4905 for it, cross-linking to here, so I don't see a reason to keep the PR open.

@jbrockmendel

Copy link
Copy Markdown
Contributor Author

That's actually pretty reasonable. Let's see what other non-mergeable PRs can be closed by the same logic. Many of them are long-abandoned.

@josef-pkt

Copy link
Copy Markdown
Member

the difference is that old PRs that add new features contain useful information for implementing or reimplementing those features.

This PR just (re)moves code when it is not clear where the final location of the function will be and which version of the function and returns we want to keep in the end.
It's unlikely that we keep the diagnostic_other location or version.

also both modules are _private because the final design and location is unclear, independently where the official path will be

@jbrockmendel

Copy link
Copy Markdown
Contributor Author

This PR just (re)moves code when it is not clear where the final location of the function will be and

This PR prevents further drift in copy/pasted code, which has already caused one possible-bug. One possibly-bug that you've avoided discussing because you are reflexively hostile. Consider putting a pin in this for a couple months.

@josef-pkt

Copy link
Copy Markdown
Member

Drift in code is part of the development process and can be intentional.

This type of functions need to change when we add new use cases for it. We don't have a complete blueprint for how these functions should look at the end, and we need to figure it out along the way as the use cases change and the number increases.

@jbrockmendel

Copy link
Copy Markdown
Contributor Author

I’m not getting into the “development process” discussion again. It only leads to a gif of Inigo Montoya asking what you thin YAGNI means.

@josef-pkt

Copy link
Copy Markdown
Member

I’m not getting into the “development process” discussion again.

The why do you keep submitting these PRs?
The code comment and my reply mentioned that it is intended, the docstring says it's experimental, and another code comment mentions that a hidden option is not yet working.
Plus the code has been adjusted to match the new use case and so intentionally diverges from the original version..

If you don't want to waste your and my time arguing about the development process and repeating it each time again, then stick to it.
My impression is that you are not listening to anything I'm saying and just keep going on with the code prettification crusade.

Many of those are useful, but proposing or making soooooooo many cleanup changes is not.

Except for #5741, I haven't seen any interesting statistics or econometrics question/issue in a week.

@bashtage bashtage added the rejected Used for PRs with changes that are not acceptable label Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rejected Used for PRs with changes that are not acceptable

Projects

None yet

Development

Successfully merging this pull request may close these issues.

base._parameter_inference should not copy code from _diagnostic_other

4 participants