No flags found
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
8f3c7b6
... +0 ...
9520ab8
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
899 | 899 | eta <- disc * (mu - thres) |
|
900 | 900 | y <- prep$data$Y[i] |
|
901 | 901 | # TODO: check if computation can be made more numerically stable |
|
902 | - | if (prep$family$link == "logit") { |
|
902 | + | if (prep$family$link == "logit") { |
|
903 | 903 | # more efficient computation for logit link |
|
904 | 904 | q <- sapply(1:nthres, function(k) eta[, k]) |
|
905 | 905 | p <- cbind(rep(0, nrow(eta)), q[, 1], |
980 | 980 | # @param prep a brmsprep object |
|
981 | 981 | # @return vector of log_lik values |
|
982 | 982 | log_lik_truncate <- function(x, cdf, args, i, prep) { |
|
983 | - | lb <- prep$data$lb[i] |
|
984 | - | ub <- prep$data$ub[i] |
|
985 | - | if (!(is.null(lb) && is.null(ub))) { |
|
986 | - | if (is.null(lb)) lb <- -Inf |
|
987 | - | if (is.null(ub)) ub <- Inf |
|
988 | - | x - log(do_call(cdf, c(ub, args)) - do_call(cdf, c(lb, args))) |
|
983 | + | lb <- prep$data[["lb"]][i] |
|
984 | + | ub <- prep$data[["ub"]][i] |
|
985 | + | if (is.null(lb) && is.null(ub)) { |
|
986 | + | return(x) |
|
989 | 987 | } |
|
990 | - | x |
|
988 | + | args$log.p <- TRUE |
|
989 | + | if (!is.null(lb)) { |
|
990 | + | log_cdf_lb <- do_call(cdf, c(lb, args)) |
|
991 | + | } else { |
|
992 | + | log_cdf_lb <- rep(-Inf, length(x)) |
|
993 | + | } |
|
994 | + | if (!is.null(ub)) { |
|
995 | + | log_cdf_ub <- do_call(cdf, c(ub, args)) |
|
996 | + | } else { |
|
997 | + | log_cdf_ub <- rep(0, length(x)) |
|
998 | + | } |
|
999 | + | x - log_diff_exp(log_cdf_ub, log_cdf_lb) |
|
991 | 1000 | } |
|
992 | 1001 | ||
993 | 1002 | # weight log_lik values according to defined weights |
Files | Coverage |
---|---|
R | +<.01% 82.25% |
Project Totals (70 files) | 82.25% |
9520ab8
8f3c7b6