View source: R/adaptive_utils.R
aw_scores | R Documentation |
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)
yobs |
Numeric vector. Observed rewards. Must not contain NA values. |
ws |
Integer vector. Pulled arms. Must not contain NA values. Length must match |
balwts |
Numeric matrix. Inverse probability score |
K |
Integer. Number of arms. Must be a positive integer. |
mu_hat |
Optional numeric matrix. Plug-in estimator of arm outcomes, shape |
Numeric matrix. AIPW scores, shape [A, K]
.
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.