Skip to content

Commit b6e27c3

Browse files
authored
Merge pull request #190 from StochasticTree/rfx-initialization-hotfix
Updated random effects initialization
2 parents 7bfe604 + 90a27e2 commit b6e27c3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

R/bart.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,9 +696,9 @@ bart <- function(X_train, y_train, leaf_basis_train = NULL, rfx_group_ids_train
696696
# Prior parameters
697697
if (is.null(rfx_working_parameter_prior_mean)) {
698698
if (num_rfx_components == 1) {
699-
alpha_init <- c(1)
699+
alpha_init <- c(0)
700700
} else if (num_rfx_components > 1) {
701-
alpha_init <- c(1,rep(0,num_rfx_components-1))
701+
alpha_init <- rep(0,num_rfx_components)
702702
} else {
703703
stop("There must be at least 1 random effect component")
704704
}

R/bcf.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -878,9 +878,9 @@ bcf <- function(X_train, Z_train, y_train, propensity_train = NULL, rfx_group_id
878878
# Prior parameters
879879
if (is.null(rfx_working_parameter_prior_mean)) {
880880
if (num_rfx_components == 1) {
881-
alpha_init <- c(1)
881+
alpha_init <- c(0)
882882
} else if (num_rfx_components > 1) {
883-
alpha_init <- c(1,rep(0,num_rfx_components-1))
883+
alpha_init <- rep(0,num_rfx_components)
884884
} else {
885885
stop("There must be at least 1 random effect component")
886886
}

0 commit comments

Comments
 (0)