diff --git a/R/latent_lognormal.R b/R/latent_lognormal.R index a9de72c26..485576496 100644 --- a/R/latent_lognormal.R +++ b/R/latent_lognormal.R @@ -8,7 +8,7 @@ #' @param ... Additional arguments #' @autoglobal #' @keywords internal -posterior_predict_latent_lognormal <- function(i, prep, ...) { # nolint: object_length_linter +posterior_predict_latent <- function(i, prep, ...) { # nolint: object_length_linter mu <- brms::get_dpar(prep, "mu", i = i) sigma <- brms::get_dpar(prep, "sigma", i = i) @@ -42,7 +42,7 @@ posterior_predict_latent_lognormal <- function(i, prep, ...) { # nolint: object_ #' @param prep The result of a call to [`brms::prepare_predictions`] #' @autoglobal #' @keywords internal -posterior_epred_latent_lognormal <- function(prep) { # nolint: object_length_linter +posterior_epred_latent <- function(prep) { # nolint: object_length_linter mu <- brms::get_dpar(prep, "mu") sigma <- brms::get_dpar(prep, "sigma") exp(mu + sigma^2 / 2) @@ -56,7 +56,7 @@ posterior_epred_latent_lognormal <- function(prep) { # nolint: object_length_lin #' @param prep The result of a call to [brms::prepare_predictions()] #' @autoglobal #' @keywords internal -log_lik_latent_lognormal <- function(i, prep) { +log_lik_latent <- function(i, prep) { mu <- brms::get_dpar(prep, "mu", i = i) sigma <- brms::get_dpar(prep, "sigma", i = i) y <- prep$data$Y[i] diff --git a/R/latent_model.R b/R/latent_model.R index 99ccdd5c9..f2939d6aa 100644 --- a/R/latent_model.R +++ b/R/latent_model.R @@ -89,7 +89,10 @@ epidist_family_model.epidist_latent_model <- function( ub = c(NA, as.numeric(lapply(family$other_bounds, "[[", "ub"))), type = family$type, vars = c("pwindow", "swindow", "vreal1"), - loop = FALSE + loop = FALSE, + log_lik = log_lik_latent, + posterior_predict = posterior_predict_latent, + posterior_epred = posterior_epred_latent ) custom_family$reparm <- family$reparm return(custom_family) diff --git a/man/log_lik_latent_lognormal.Rd b/man/log_lik_latent.Rd similarity index 82% rename from man/log_lik_latent_lognormal.Rd rename to man/log_lik_latent.Rd index 4cac6907c..ecadb37a5 100644 --- a/man/log_lik_latent_lognormal.Rd +++ b/man/log_lik_latent.Rd @@ -1,10 +1,10 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/latent_lognormal.R -\name{log_lik_latent_lognormal} -\alias{log_lik_latent_lognormal} +\name{log_lik_latent} +\alias{log_lik_latent} \title{Calculate the pointwise log likelihood of the \code{latent_gamma} family} \usage{ -log_lik_latent_lognormal(i, prep) +log_lik_latent(i, prep) } \arguments{ \item{i}{The index of the observation to calculate the log likelihood of} diff --git a/man/posterior_epred_latent_lognormal.Rd b/man/posterior_epred_latent.Rd similarity index 78% rename from man/posterior_epred_latent_lognormal.Rd rename to man/posterior_epred_latent.Rd index c8fb0d6ac..8bce50dd1 100644 --- a/man/posterior_epred_latent_lognormal.Rd +++ b/man/posterior_epred_latent.Rd @@ -1,11 +1,11 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/latent_lognormal.R -\name{posterior_epred_latent_lognormal} -\alias{posterior_epred_latent_lognormal} +\name{posterior_epred_latent} +\alias{posterior_epred_latent} \title{Draws from the expected value of the posterior predictive distribution of the \code{latent_gamma} family} \usage{ -posterior_epred_latent_lognormal(prep) +posterior_epred_latent(prep) } \arguments{ \item{prep}{The result of a call to \code{\link[brms:prepare_predictions]{brms::prepare_predictions}}} diff --git a/man/posterior_predict_latent_lognormal.Rd b/man/posterior_predict_latent.Rd similarity index 79% rename from man/posterior_predict_latent_lognormal.Rd rename to man/posterior_predict_latent.Rd index bb5612305..997936ae2 100644 --- a/man/posterior_predict_latent_lognormal.Rd +++ b/man/posterior_predict_latent.Rd @@ -1,11 +1,11 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/latent_lognormal.R -\name{posterior_predict_latent_lognormal} -\alias{posterior_predict_latent_lognormal} +\name{posterior_predict_latent} +\alias{posterior_predict_latent} \title{Draws from the posterior predictive distribution of the \code{latent_lognormal} family} \usage{ -posterior_predict_latent_lognormal(i, prep, ...) +posterior_predict_latent(i, prep, ...) } \arguments{ \item{i}{The index of the observation to predict}