@@ -102,9 +102,9 @@ bart_model <- bart(X_train=X_train, y_train=y_train, X_test=X_test, mean_forest_
102102
103103# Extract kernels needed for kriging
104104leaf_mat_train <- computeForestLeafIndices(bart_model, X_train, forest_type = "mean",
105- forest_inds = bart_model$model_params$num_samples)
105+ forest_inds = bart_model$model_params$num_samples - 1 )
106106leaf_mat_test <- computeForestLeafIndices(bart_model, X_test, forest_type = "mean",
107- forest_inds = bart_model$model_params$num_samples)
107+ forest_inds = bart_model$model_params$num_samples - 1 )
108108W_train <- sparseMatrix(i=rep(1:length(y_train),num_trees), j=leaf_mat_train + 1, x=1)
109109W_test <- sparseMatrix(i=rep(1:length(y_test),num_trees), j=leaf_mat_test + 1, x=1)
110110Sigma_11 <- tcrossprod(W_test) / num_trees
@@ -179,9 +179,9 @@ bart_model <- bart(X_train=X_train, y_train=y_train, X_test=X_test, mean_forest_
179179
180180# Extract kernels needed for kriging
181181leaf_mat_train <- computeForestLeafIndices(bart_model, X_train, forest_type = "mean",
182- forest_inds = bart_model$model_params$num_samples)
182+ forest_inds = bart_model$model_params$num_samples - 1 )
183183leaf_mat_test <- computeForestLeafIndices(bart_model, X_test, forest_type = "mean",
184- forest_inds = bart_model$model_params$num_samples)
184+ forest_inds = bart_model$model_params$num_samples - 1 )
185185W_train <- sparseMatrix(i=rep(1:length(y_train),num_trees), j=leaf_mat_train + 1, x=1)
186186W_test <- sparseMatrix(i=rep(1:length(y_test),num_trees), j=leaf_mat_test + 1, x=1)
187187Sigma_11 <- tcrossprod(W_test) / num_trees
0 commit comments