aw_scores {banditsCI} | R Documentation |
Compute AIPW/doubly robust scores.
Description
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.
Usage
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 |
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 |
Value
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))
[Package banditsCI version 1.0.0 Index]