aw_scores function

Compute AIPW/doubly robust scores.

Compute AIPW/doubly robust scores.

Computes AIPW/doubly robust scores based on observed rewards, pulled arms, and inverse probability scores. If mu_hat is provided, compute AIPW scores, otherwise compute IPW scores.

aw_scores(yobs, ws, balwts, K, mu_hat = NULL)

Arguments

  • yobs: Numeric vector. Observed rewards. Must not contain NA values.
  • ws: Integer vector. Pulled arms. Must not contain NA values. Length must match yobs.
  • balwts: Numeric matrix. Inverse probability score 1[Wt=w]/et(w)1[W_t=w]/e_t(w) of pulling arms, shape [A, K], where A is the number of observations and K is the number of arms. Must not contain NA values.
  • K: Integer. Number of arms. Must be a positive integer.
  • mu_hat: Optional numeric matrix. Plug-in estimator of arm outcomes, shape [A, K], or NULL. Must not contain NA values if provided.

Returns

Numeric matrix. AIPW scores, shape [A, K].

Examples

aw_scores(yobs = c(0.5, 1, 0, 1.5), ws = c(1, 2, 2, 3), balwts = matrix(c(0.5, 2, 1, 0.5, 1, 1.5, 0.5, 1.5, 2, 1.5, 0.5, 1), ncol = 3), K = 3, mu_hat = matrix(c(0.5, 0.8, 0.6, 0.3, 0.9, 0.2, 0.5, 0.7, 0.4, 0.8, 0.2, 0.6), ncol = 3))