Skip to content

Bug fix for scale issue in loglike of LS models and typo fixes - #1173

Closed
bashtage wants to merge 7 commits into
statsmodels:masterfrom
bashtage:master
Closed

bashtage wants to merge 7 commits into
statsmodels:masterfrom
bashtage:master

Conversation

@bashtage

@bashtage bashtage commented Nov 3, 2013

Copy link
Copy Markdown
Member

BUG: Replaced log(det(x)) with slogdet(x) to avoid numerical problems in loglike
ENH: Many typos fixed
ENH: Better PEP8 compliance in a few places

… in loglike

ENH: Many typos fixed
ENH: Better PEP8 compliance in a few places
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage remained the same when pulling 6067874 on bashtage:master into 831e2ad on statsmodels:master.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

slogdet was added in numpy 1.6.0, so it is fine to use now for statsmodels 0.6

(There might be some more places where we can clean up for numpy < 1.6)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Probably a good idea as it isn't very hard to create numerical problems using poorly scaled data if only the log determinant is needed.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage remained the same when pulling 0fd444f on bashtage:master into 831e2ad on statsmodels:master.

Added test coverage for some corner cases of WLS, which revealed a bug
in WLS.
Added test coverage for norm_resid, which was also incorrect.
Added exception checks for GLS sigma with wrong sizes.
Added test for QR where Q,R are user provided.  Revealed a bug in this code.
Fixes bugs mostly in checks for correctness on input for GLS and WLS for
the sigma or weights.
norm_resid now produces the output described in the doc string
@bashtage

bashtage commented Nov 7, 2013

Copy link
Copy Markdown
Member Author

I have expanded the test coverage and fixed three bugs (which the tests found) in the latest commit.

Comment thread statsmodels/regression/linear_model.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Stray print or is this intentional?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we need the prints? I don't think standard output is suppressed by nose, though I can't recall.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Forgot to purge these.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage remained the same when pulling 5f1b15d on bashtage:master into 831e2ad on statsmodels:master.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage remained the same when pulling 5f1b15d on bashtage:master into 831e2ad on statsmodels:master.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage remained the same when pulling 41687b3 on bashtage:master into 831e2ad on statsmodels:master.

The corner case of using pre-computed QR did not check all required
inputs were available.  Slight improvement in test coverage.
Added test for norm resid when model fits perfectly.
Fixes test for incorrect sigma array test.
Fixes test for direct vs computed QR eigenvalues.
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage remained the same when pulling c9d1b20 on bashtage:master into 831e2ad on statsmodels:master.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why did you add another nobs here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Aren’t there 3 %s split across 2 lines? PyCharm gave a warning.

Kevin

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes there are, but I didn't see the one from the first line.

@josef-pkt

Copy link
Copy Markdown
Member

Looks good, no problem merging.

Is behind master, but in a straight line in the network. I prefer a rebase before merging.

@bashtage After this is merged, you could delete your master branch and get a clean branch by creating a new master branch from statsmodels/master. And then it's better to make all changes in "feature" branches.

@bashtage

Copy link
Copy Markdown
Member Author

Yes, that is the plan. The whole master thing was not the right strategy.

@josef-pkt josef-pkt closed this in e3fd1f2 Dec 11, 2013
PierreBdR pushed a commit to PierreBdR/statsmodels that referenced this pull request Sep 2, 2014
@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.

4 participants