grf icon indicating copy to clipboard operation
grf copied to clipboard

tau.hat to large

Open fangjiany opened this issue 3 years ago • 1 comments
trafficstars

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)

fangjiany avatar May 11 '22 14:05 fangjiany

Hi @fangjiany, could you give a simulation/data example for this?

erikcs avatar May 12 '22 23:05 erikcs