grf
grf copied to clipboard
tau.hat to large
First thanks to your team for the code and comments. When I was programming, the tau.hat was too large. The value range was between -400 and 100. The normal tau.hat was smaller, about -2 to 2. Where could my mistake be? Below is my code: Y.forest = regression_forest(X, Y) Y.hat = predict(Y.forest)$predictions W.forest = regression_forest(X, W) W.hat = predict(W.forest)$predictions
cf.raw = causal_forest(X, Y, W, Y.hat = Y.hat, W.hat = W.hat) varimp = variable_importance(cf.raw) selected.idx = which(varimp > mean(varimp))
cf = causal_forest(X[,selected.idx], Y, W, Y.hat = Y.hat, W.hat = W.hat, tune.parameters = "all") tau.hat = predict(cf)$predictions hist(tau.hat)
Hi @fangjiany, could you give a simulation/data example for this?