jaredsmurray / bcf

Bayesian Causal Forests
40 stars 20 forks source link

Bugs of test_pred2.R #16

Open Naoaki-H opened 3 years ago

Naoaki-H commented 3 years ago

When I run test_pred2.R, there are bugs like this.

out2 <- bcf::bcf(y               = y,
                  z               = z,
                  x_control       = x,
                  x_moderate      = x,
                  pihat           = pi,
                  nburn           = n_burn,
                  nsim            = n_sim,
                  w               = weights,
                  n_chains        = 2,
                  nthin           = 3,
                  update_interval = 1)

Error in bcf::bcf(y = y, z = z, x_control = x, x_moderate = x, pihat = pi, : unused arguments (w = weights, n_chains = 2)

By following the message, and removing the arguments w and n_chains, it worked.

However, next problem happened;

pred_out = predict(object=out2,
                    x_predict_control=x,
                    x_predict_moderate=x,
                    pi_pred=pi,
                    z_pred=z,
                    save_tree_directory = '..')

Error message: Error in UseMethod("predict") : no applicable method for 'predict' applied to an object of class "c('double', 'numeric')"

Since I don't have any idea to fix this error, I'm bothered with this bug.

How should we do?