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

posterior_linpred() for ordinal families: argument for taking the intercept into account #1137

Merged
merged 34 commits into from
May 5, 2021
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
a609e11
Introduce an argument to posterior_linpred() for taking the intercept…
fweber144 Apr 12, 2021
fcd2c21
Add a NEWS entry.
fweber144 Apr 12, 2021
0a68dae
Insert GitHub PR number.
fweber144 Apr 12, 2021
40e43ac
Merge branch 'master' into projpred_augdat
fweber144 Apr 13, 2021
ec4126c
Merge branch 'master' into projpred_augdat
fweber144 Apr 14, 2021
448e813
Merge branch 'master' into projpred_augdat
fweber144 Apr 14, 2021
7b696c2
Merge branch 'master' into projpred_augdat
fweber144 Apr 29, 2021
de47fdd
add 'slice' function
paul-buerkner Apr 29, 2021
837a8e5
refactor 'dcumulative'
paul-buerkner Apr 29, 2021
3a431d8
update implementation of 'incl_thres'
paul-buerkner Apr 29, 2021
63ba13e
fix typo
paul-buerkner Apr 29, 2021
827591f
Re-indent tests/local/tests.models_new.R
fweber144 Apr 30, 2021
8e7f4fe
Add (preliminary) tests for argument `incl_thres` of posterior_linpre…
fweber144 Apr 30, 2021
4adac19
Fix a test for argument `incl_thres` of posterior_linpred() (the one …
fweber144 Apr 30, 2021
089e506
Remove an unnecessary check.
fweber144 Apr 30, 2021
d689fd7
Fix a typo.
fweber144 Apr 30, 2021
b690b75
posterior_epred_ordinal() in case of grouped thresholds: Fill missing…
fweber144 Apr 30, 2021
71eb8eb
Merge branch 'master' into projpred_augdat
fweber144 May 1, 2021
8eb1157
posterior_epred_ordinal() in case of grouped thresholds: For the "ide…
fweber144 May 1, 2021
650b732
Replace remaining extract_col() occurrences by slice_col().
fweber144 May 1, 2021
e089a4d
minor cleaning
paul-buerkner May 2, 2021
5c1c2e3
Internally document dcumulative() and inv_link_cumulative().
fweber144 May 3, 2021
00148e1
In inv_link_cumulative(): Overwrite `x`.
fweber144 May 3, 2021
64080d3
Create and use inv_link_sratio().
fweber144 May 3, 2021
1da7f7e
Create and use inv_link_cratio().
fweber144 May 3, 2021
b0bde2f
Create and use inv_link_acat().
fweber144 May 3, 2021
5b4b3f9
Test that d<ordinal_family>() works correctly.
fweber144 May 4, 2021
5fa503e
Add argument `drop` to slice().
fweber144 May 4, 2021
aadc683
inv_link_sratio(), inv_link_cratio(), and inv_link_acat(): Allow for …
fweber144 May 4, 2021
d7e50bf
Test that inv_link_<ordinal_family>() works correctly for arrays.
fweber144 May 4, 2021
5c2cdb4
minor cleaning
paul-buerkner May 5, 2021
2438629
add frank as contributor
paul-buerkner May 5, 2021
68b4fe7
some more minor cleaning
paul-buerkner May 5, 2021
c841e36
more cleaning
paul-buerkner May 5, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add argument drop to slice().
  • Loading branch information
fweber144 committed May 5, 2021
commit 5fa503ea4480bbcea3b1f6a793fa7059caa30af0
6 changes: 4 additions & 2 deletions R/misc.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,13 @@ extract <- function(x, ..., drop = FALSE, drop_dim = NULL) {
# @param x an array
# @param dim dimension from which to take the slice
# @param i slice index
slice <- function(x, dim, i) {
# @param drop Logical (length 1) indicating whether to drop dimension `dim`.
slice <- function(x, dim, i, drop = TRUE) {
ndim <- length(dim(x))
commas1 <- collapse(rep(", ", dim - 1))
commas2 <- collapse(rep(", ", ndim - dim))
expr <- paste0("extract(x, ", commas1, "i", commas2, ", drop_dim = dim)")
drop_dim <- ifelse(drop, ", drop_dim = dim", "")
expr <- paste0("extract(x, ", commas1, "i", commas2, drop_dim, ")")
eval2(expr)
}

Expand Down