Computes the integrand for adaptive quadrature double integration in IsoXshift by combining the models for outcome given mediator and exposure (q_model), the density of the mediator given exposure and covariates (r_model), and the density of the exposure given covariates (g_model).

quad_integrand_q_g_r(
  a,
  z,
  row_data,
  covars,
  w_names,
  q_model,
  g_model,
  r_model,
  exposure,
  mediator,
  delta,
  upper_a,
  density_type
)

Arguments

a

Numeric matrix, grid points for the exposure.

z

Numeric matrix, grid points for the mediator.

row_data

Data frame, containing the data for a single observation.

covars

Character vector, names of the covariate columns in the data.

w_names

Character vector, names of the baseline covariate columns in the data.

q_model

Fitted Super Learner model, the outcome model given mediator and exposure.

g_model

Fitted Super Learner or parametric model, the exposure density given covariates.

r_model

Fitted Super Learner or parametric model, the mediator density given exposure and covariates.

exposure

Character, name of the exposure variable in the data.

mediator

Character, name of the mediator variable in the data.

delta

Numeric, the amount to shift the exposure variable.

upper_a

Numeric, the upper bound for the exposure variable.

density_type

Character, either "sl" for Super Learner or "hal" for highly adaptive lasso

Value

Numeric matrix, the computed values of the integrand.