:package: :game_die: R/txshift: Efficient Estimation of the Causal Effects of Stochastic Interventions, with Corrections for Outcome-Dependent Sampling
I think these small fixes should do the trick. The fixes are as follows:
change mean to sum when computing the parameter estimate (we can discuss on our call why this is needed.
change the default mean of EIF tolerance to be 1/n -- we only want to iterate until we get something smaller than c_n, where we choose c_n such that it's o(n^{-1/2}), e.g., 1/sqrt(n) or 1/n.
the function for estimating the outcome regression appears to scale the results to be between 0 and 1, while the function for fluctuating these estimates return unscaled outcome regression values. Thus, when iterating unscaled values were being fed back into the fluctuation function, which was expecting scaled values. So I added scaled values to the updating of Qn_estim_use
Based on a few by-hand runs on my computer, things appear to be giving sane answers with these fixes.
A couple other notes of things we may want to study in simulation that we might want to add:
Maybe good to keep track of how psi changes with iteration (including an initial estimate of psi)
Might as well also keep track of the variance estimate too, so we can examine e.g., how well the first step tmle performs vs. the full blown iterative
Good idea to keep track of the number of iterations
I think these small fixes should do the trick. The fixes are as follows:
mean
tosum
when computing the parameter estimate (we can discuss on our call why this is needed.1/n
-- we only want to iterate until we get something smaller than c_n, where we choose c_n such that it's o(n^{-1/2}), e.g.,1/sqrt(n)
or1/n
.Qn_estim_use
Based on a few by-hand runs on my computer, things appear to be giving sane answers with these fixes.
A couple other notes of things we may want to study in simulation that we might want to add:
psi
changes with iteration (including an initial estimate of psi)