Skip to content

creates a generic elpd function#159

Merged
jgabry merged 9 commits into
stan-dev:masterfrom
bnicenboim:master
Nov 12, 2020
Merged

creates a generic elpd function#159
jgabry merged 9 commits into
stan-dev:masterfrom
bnicenboim:master

Conversation

@bnicenboim

Copy link
Copy Markdown
Contributor

No description provided.

@bnicenboim bnicenboim changed the title creates a generic elpd function #158 creates a generic elpd function Nov 10, 2020
@bnicenboim bnicenboim mentioned this pull request Nov 10, 2020

@jgabry jgabry left a comment

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.

This looks great, thanks Bruno! I made just a few tiny review comments.

@paul-buerkner If you have a chance can you also take a quick look at this in case you have any other suggestions or noticed a potential issue I missed. It's a small PR so should just take a few minutes.

Comment thread R/elpd.R Outdated
Comment thread R/elpd.R Outdated
@jgabry jgabry linked an issue Nov 10, 2020 that may be closed by this pull request
@codecov-io

codecov-io commented Nov 10, 2020

Copy link
Copy Markdown

Codecov Report

Merging #159 (76f319d) into master (51fb2d0) will decrease coverage by 0.15%.
The diff coverage is 75.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #159      +/-   ##
==========================================
- Coverage   95.30%   95.15%   -0.16%     
==========================================
  Files          27       28       +1     
  Lines        2642     2662      +20     
==========================================
+ Hits         2518     2533      +15     
- Misses        124      129       +5     
Impacted Files Coverage Δ
R/elpd.R 75.00% <75.00%> (ø)

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 51fb2d0...76f319d. Read the comment docs.

@jgabry

jgabry commented Nov 10, 2020

Copy link
Copy Markdown
Member

I wasn't thinking about this before when reviewing, but we should also add a few tests for this. @bnicenboim are you familiar with using the testthat framework?

@bnicenboim

Copy link
Copy Markdown
Contributor Author

yeah, but test it against what? As in test_loo_and_waic.R against a reference?

@jgabry

jgabry commented Nov 10, 2020

Copy link
Copy Markdown
Member

You could test that the matrix and array methods give the same answer when they should (although that's less necessary now that the array method calls the matrix method, but I guess it's still good to have a test that will let us know if we mess that up in the future). And yeah you could also compare to a reference value like we do for the others. That way we can make sure that the results don't change accidentally. So there's not too much to test here (it's a pretty simple function) but it's still good to have a few basic sanity checks.

@bnicenboim

Copy link
Copy Markdown
Contributor Author

ok, done, I just added them to the loo_waic test file since they were so similar

@bnicenboim

Copy link
Copy Markdown
Contributor Author

in the meanwhile I also did a vignette, I hope it's fine that I'm adding this to the same PR

@jgabry

jgabry commented Nov 11, 2020

Copy link
Copy Markdown
Member

ok, done, I just added them to the loo_waic test file since they were so similar

Awesome, thanks!

in the meanwhile I also did a vignette, I hope it's fine that I'm adding this to the same PR

Yeah, that's great. I haven't had a chance to go through the vignette yet but I'll take a look soon.

@jgabry

jgabry commented Nov 12, 2020

Copy link
Copy Markdown
Member

I read through the vignette and I think it's great. I also pushed a commit to the PR branch adding you to the DESCRIPTION file as a contributor and adding an item to NEWS. This seems ready to merge so I'm going to approve this. Will wait a little while to merge just in case @avehtari or @paul-buerkner wants to take a look before we merge this.

@paul-buerkner

Copy link
Copy Markdown
Contributor

Looks good to me. Thank you @bnicenboim!

@avehtari avehtari left a comment

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.

This is a great addition. I went through the vignette and have some requests for changes.

Comment thread vignettes/elpd.Rmd Outdated
Comment thread vignettes/elpd.Rmd Outdated
Comment thread vignettes/elpd.Rmd Outdated
Comment thread vignettes/elpd.Rmd Outdated
Comment thread vignettes/elpd.Rmd Outdated
Comment thread vignettes/elpd.Rmd Outdated
Comment thread vignettes/elpd.Rmd Outdated
Comment thread vignettes/elpd.Rmd Outdated
Comment thread vignettes/elpd.Rmd Outdated
Comment thread vignettes/elpd.Rmd Outdated
@bnicenboim

Copy link
Copy Markdown
Contributor Author

Thanks Aki!
Let me know if there's something still missing.

@avehtari

Copy link
Copy Markdown
Member

All ok

@jgabry

jgabry commented Nov 12, 2020

Copy link
Copy Markdown
Member

Thanks for all the suggestions Aki and thanks for making the changes so quickly Bruno. Will merge this now!

@jgabry jgabry merged commit 4731b30 into stan-dev:master Nov 12, 2020
@jgabry

jgabry commented Nov 12, 2020

Copy link
Copy Markdown
Member

I also pushed a commit to the PR branch adding you to the DESCRIPTION file as a contributor and adding an item to NEWS.

Actually it looks like maybe I never pushed this. I'll add you as a contributor and add a news item now on the master branch.

@bnicenboim

Copy link
Copy Markdown
Contributor Author

cool, and BTW, when does the vignette get compiled? When the new version goes to CRAN?

@jgabry

jgabry commented Nov 12, 2020

Copy link
Copy Markdown
Member

Yeah when it goes to CRAN. We don't really have to wait until then, we could add it to the website now, but if we did that then people wouldn't be able to run the code with the CRAN version of loo (because it doesn't have the elpd function yet). But we can do a CRAN release soon. In fact I'll open an issue now to see if anyone else has anything they were hoping to get in to the next release. If not then I can start preparing the release.

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.

generic elpd function

5 participants