-
Notifications
You must be signed in to change notification settings - Fork 6
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
Expand marginal model distribution support #488
Comments
How easy would these be to implement and submit as PRs to |
they are all internal functions and I have no idea |
https://github.com/paul-buerkner/brms/blob/2e5177a7df2bbdf699ac71f04dbaab8fdb9ca3da/R/log_lik.R#L990 seems to look quite a generic solution? # ----------- log_lik helper-functions -----------
# compute (possibly censored) log_lik values
# @param dist name of a distribution for which the functions
# d<dist> (pdf) and p<dist> (cdf) are available
# @param args additional arguments passed to pdf and cdf
# @param prep a brmsprep object
# @return vector of log_lik values
log_lik_censor <- function(dist, args, i, prep) {
pdf <- get(paste0("d", dist), mode = "function")
cdf <- get(paste0("p", dist), mode = "function")
y <- prep$data$Y[i]
cens <- prep$data$cens[i]
if (is.null(cens) || cens == 0) {
x <- do_call(pdf, c(y, args, log = TRUE))
} else if (cens == 1) {
x <- do_call(cdf, c(y, args, lower.tail = FALSE, log.p = TRUE))
} else if (cens == -1) {
x <- do_call(cdf, c(y, args, log.p = TRUE))
} else if (cens == 2) {
rcens <- prep$data$rcens[i]
x <- log(do_call(cdf, c(rcens, args)) - do_call(cdf, c(y, args)))
}
x
} |
This was done when #477 was closed so closing. In terms of other distributions support I plan to handle this by letting users report distribution bugs and work from there as there is a wide surface area of potential issues and it seems better to be guided by user demand. |
In #426 support was added for Weibull, Lognormal, and Gamma.
primarycensored
supports many more distributions that this so we can extend this. This will be easier if we wait for epinowcast/primarycensored#175Once this has been completed we can support everything that
primarycensored
supports but our posterior prediction and R side log lik will be limited to distributions wherebrms
uses an internallog_lik_censor
call. I think to close this issue we should document what those are and open a new issue for extending support.The text was updated successfully, but these errors were encountered: