library("polle")
### Single stage:
d <- sim_single_stage(5e2, seed=1)
pd <- policy_data(d, action="A", covariates=list("Z", "B", "L"), utility="U")
pd
# defining a static policy (A=1):
pl <- policy_def(1, name = "A=1")
# doubly robust evaluation of the policy:
pe <- policy_eval(policy_data = pd,
policy = pl,
g_models = g_glm(),
q_models = q_glm())
# summarizing the estimated value of the policy:
pe
# getting the fitted g-function values:
head(predict(get_g_functions(pe), pd))
# getting the fitted Q-function values:
head(predict(get_q_functions(pe), pd))
Run the code above in your browser using DataLab