Skip to content

Commit

Permalink
Merge pull request #1456 from fweber144/projpred_version_latent
Browse files Browse the repository at this point in the history
Check projpred version for latent projection
  • Loading branch information
paul-buerkner authored Feb 14, 2023
2 parents d3f8a54 + 75cedce commit b31fcee
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ via the `hurdle_cumulative` family thanks to Stephen Wild. (#1448)
in post-processing methods that require a compiled Stan model.
* Extend control over the `point_estimate` feature in `prepare_predictions`
via the new argument `ndraws_point_estimate`.
* Add support for the latent projection available in **projpred** versions >
2.3.0.
* Add support for the latent projection available in **projpred** versions >=
2.4.0.

### Bug Fixes

Expand Down
4 changes: 3 additions & 1 deletion R/projpred.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
#' \code{\link[projpred:init_refmodel]{init_refmodel}}, but leave this at
#' \code{NULL} unless \pkg{projpred} complains about it.
#' @param latent See argument \code{latent} of
#' \code{\link[projpred:extend_family]{extend_family}}.
#' \code{\link[projpred:extend_family]{extend_family}}. Setting this to
#' \code{TRUE} requires a \pkg{projpred} version >= 2.4.0.
#' @param brms_seed A seed used to infer seeds for \code{\link{kfold.brmsfit}}
#' and for sampling group-level effects for new levels (in multilevel models).
#' @param ... Further arguments passed to
Expand Down Expand Up @@ -206,6 +207,7 @@ get_refmodel.brmsfit <- function(object, newdata = NULL, resp = NULL,
)
}
} else if (latent) {
require_package("projpred", "2.4.0")
if (family$family == "cumulative") {
args$latent_ilink <- latent_ilink_cumulative(
object = object, family = family, bterms = bterms, resp = resp
Expand Down
3 changes: 2 additions & 1 deletion man/get_refmodel.brmsfit.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b31fcee

Please sign in to comment.