Integrate Psi G for the Da part of the EIF for stochastic mediation using Monte Carlo integration

integrate_psi_g_cont(
  av,
  at,
  covars,
  w_names,
  q_model,
  r_model,
  g_model,
  exposure,
  mediator,
  delta,
  n_samples,
  density_type,
  integration_method
)

Arguments

av

A dataframe with the natural value of the exposure

at

A dataframe with the upshift of the exposure

covars

A vector of covariate names

w_names

A vector of covariate names

q_model

A fitted Q-model

r_model

A fitted R-model (mediator density estimator)

g_model

A fitted G-model (the training data)

exposure

A string indicating the name of the exposure variable

mediator

A string indicating the name of the mediator variable

delta

A numeric indicating the magnitude of the shift for the exposure

n_samples

A numeric specifying the number of samples for Monte Carlo integration

density_type

A string specifying the type of density estimation ("sl" for Super Learner)

integration_method

A string specifying the integration method to use ("MC" for Monte Carlo, "AQ" for Adaptive Quadrature)

Value

A list with three elements: "d_a" containing the estimates of Da, "phi_aw" containing the estimates of the outcome mechanism at the natural value of the exposure Q(A, W), and "phi_aw_g" containing the estimates of the outcome mechanism at the upshift of the exposure Q(A + delta, W)

Details

Computes the double integration as described in lemma 1 using either Monte Carlo or adaptive quadrature methods.