calculate_balwts {banditsCI} | R Documentation |
Calculate balancing weight scores.
Description
Calculates the inverse probability score of pulling arms, given the actions taken and the true probabilities of each arm being chosen.
Usage
calculate_balwts(ws, probs)
Arguments
ws |
Integer vector. Indicates which arm was chosen for observations at each time |
probs |
Numeric matrix or array. True probabilities of each arm being chosen at each time step. Shape |
Value
A matrix or array containing the inverse probability score of pulling arms.
Examples
set.seed(123)
A <- 5
K <- 3
ws <- sample(1:K, A, replace = TRUE)
probs <- matrix(runif(A * K), nrow = A, ncol = K)
balwts <- calculate_balwts(ws, probs)
[Package banditsCI version 1.0.0 Index]