From 90a27e278b12aec10cd44c851b22d8b367a37c61 Mon Sep 17 00:00:00 2001 From: Drew Herren Date: Fri, 5 Sep 2025 11:04:58 -0400 Subject: [PATCH] Updated random effects initialization --- R/bart.R | 4 ++-- R/bcf.R | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/bart.R b/R/bart.R index 2f334682..7fe1c3de 100644 --- a/R/bart.R +++ b/R/bart.R @@ -696,9 +696,9 @@ bart <- function(X_train, y_train, leaf_basis_train = NULL, rfx_group_ids_train # Prior parameters if (is.null(rfx_working_parameter_prior_mean)) { if (num_rfx_components == 1) { - alpha_init <- c(1) + alpha_init <- c(0) } else if (num_rfx_components > 1) { - alpha_init <- c(1,rep(0,num_rfx_components-1)) + alpha_init <- rep(0,num_rfx_components) } else { stop("There must be at least 1 random effect component") } diff --git a/R/bcf.R b/R/bcf.R index 86aef8cd..74e9476f 100644 --- a/R/bcf.R +++ b/R/bcf.R @@ -878,9 +878,9 @@ bcf <- function(X_train, Z_train, y_train, propensity_train = NULL, rfx_group_id # Prior parameters if (is.null(rfx_working_parameter_prior_mean)) { if (num_rfx_components == 1) { - alpha_init <- c(1) + alpha_init <- c(0) } else if (num_rfx_components > 1) { - alpha_init <- c(1,rep(0,num_rfx_components-1)) + alpha_init <- rep(0,num_rfx_components) } else { stop("There must be at least 1 random effect component") }