[x] Clone repository locally. Consider using the free version of fork for git management.
[x] Create a new branch. Make a minor change on this branch. Push it to the repository. Create a Pull Request, and ask for review from @mollyow.
Getting started with bandits code
[x] Run through TS_experiment.R script to run a simulated experiment, and start assessing results. Discuss with @mollyow.
[x] Next steps will be to work on testing the code, discussed in more detail in #7. @YinghuiZhouu will work on the data generation functions; @AmirWilliams will work on testing.
(xs):Covariates. All the variables that predict outcomes. Features of individuals. Associates with ys. There will be a matrix as long as A and as wide as p. xs affect ys
ex. Age, diet , gender, polical party
Contextual experiments include in xs in the argument. Non-contextual experiments do not include xs.
xs is a matrix of covariates
muxs: Output if there were no noise. Shape A by k. Xs and Ys are related. If everyone were the genetically identical, then they would have the same muxs, but not necessarily the same ys.
underlying truth
(ys): Potential outcomes. Shape A by k. Muxs plus random noise.
(yobs) This is the output that researchers ultimately evaluate. More noise
(A): Number of subjects (1000, usually)
(P): Number of covariates (5, in current version of code)
(K): Number of variables. In this case treatments (4, in current version of code)
Assessing the arguments and outputs of: results <- run_experiment(ys, floor_start, floor_decay, batch_sizes, xs)
Arguments:
run_experiments: function that contains 5 arguments
ys: Potential outcomes. Shape A by k. muxs plus random noise.
floor_start: 5, jointly with floor_decay, describes how we set probability floors
floor_decay: 0.9, jointly with floor_decay, describes how probability floors decay.
batch_sizes: 100, 200, 300, 400 for a total of 1000. Batches represent number of individuals being tested (sum to A)
xs: Matrix of covariates as long as A and as wide as p. xs predicts ys. Its inclusion indicates that this is a contextual experiment as factors that vary are considered among individuals.
Sub-components of results:
yobs: The outcomes that researchers ultimately evaluate. More noise.
ws: treatments assigned
xs: Matrix of covariates as long as A and as wide as p. xs predicts ys. Its inclusion indicates that this is a contextual experiment as factors that vary are considered among individuals.
ys: Potential outcomes. Shape A by k. muxs plus random noise.
probs: matrix A x A x K, representing time x context x treatment condition. Probabilities of treatment assignment
fitted_bandit_model: the model used in the algorithm
num_mc: Internal parameter: number of "monte-carlo" simulations. Number of repeated simulations used for calculating probabilities.
K: Number of treatments. In this case treatments (4, in current version of code)
p: Number of covariates (5, in current version of code)
floor_start: same as above
floor_decay: same as above
y: list of length K; Represents outcomes of subjects assigned to each treatment
ps: list of length K; Represents probabilities of subjects being assigned the treatment they received, under each different version of treatment
mu: matrix K rows by (p+1) columns; means used by model
V: (p+1) sets of data, each with (p+1) column by K rows; variance used by model
X: list of length K; Represents covariates of subjects assigned to each treatment
Warning Message
1: Option grouped=FALSE enforced in cv.glmnet, since < 3 observations per fold
2: Option grouped=FALSE enforced in cv.glmnet, since < 3 observations per fold
3: Option grouped=FALSE enforced in cv.glmnet, since < 3 observations per fold
Getting started with GitHub
Getting started with bandits code