From 08856ad52e33af7a33164ab701162ef34f444528 Mon Sep 17 00:00:00 2001 From: alexmccreight <57416850+alexmccreight@users.noreply.github.com> Date: Wed, 5 Nov 2025 13:18:46 -0600 Subject: [PATCH] predict function accounts for unmappable effects --- R/predict.susie.R | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/R/predict.susie.R b/R/predict.susie.R index 63a66c29..dbd78ca9 100644 --- a/R/predict.susie.R +++ b/R/predict.susie.R @@ -18,7 +18,16 @@ #' coef.susie <- function(object, ...) { s <- object - return(c(s$intercept, colSums(s$alpha * s$mu) / s$X_column_scale_factors)) + # Compute mappable effects + mappable_coef <- colSums(s$alpha * s$mu) / s$X_column_scale_factors + + if (!is.null(s$theta)) { + total_coef <- mappable_coef + s$theta / s$X_column_scale_factors + } else { + total_coef <- mappable_coef + } + + return(c(s$intercept, total_coef)) } #' @title Predict outcomes or extract coefficients from susie fit.