Skip to content

Commit

Permalink
add default for argument c in gp()
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-buerkner committed Feb 7, 2024
1 parent a545d8d commit b92ed99
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
9 changes: 1 addition & 8 deletions R/formula-gp.R
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
#' @seealso \code{\link{brmsformula}}
#' @export
gp <- function(..., by = NA, k = NA, cov = "exp_quad", iso = TRUE,
gr = TRUE, cmc = TRUE, scale = TRUE, c = NULL) {
gr = TRUE, cmc = TRUE, scale = TRUE, c = 5/4) {
cov <- match.arg(cov, choices = c("exp_quad"))
call <- match.call()
label <- deparse0(call)
Expand All @@ -137,13 +137,6 @@ gp <- function(..., by = NA, k = NA, cov = "exp_quad", iso = TRUE,
if (k < 1L) {
stop2("'k' must be positive.")
}
if (is.null(c)) {
stop2(
"'c' must be specified for approximate GPs. ",
"A good default could be c = 5/4 but we are still ",
"working on providing better recommendations."
)
}
c <- as.numeric(c)
if (length(c) == 1L) {
c <- rep(c, length(vars))
Expand Down
2 changes: 1 addition & 1 deletion man/gp.Rd

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

0 comments on commit b92ed99

Please sign in to comment.