This code is accompanying the paper
*Optimal Best-Arm Identification Methods for Tail-Risk Measures*  

The experiments are written in Julia. We tested on version 1.5.2.
You will need to install modules CPUTime, Distributed, JLD2, SparseArrays, LinearAlgebra, MathOptInterface, OSQP, Plots, 
Printf, Random, SpecialFunctions, Statistics.quantile, Test, Compat. 
(You can ignore this for now and follow instructions in the error message if necessary.)

The entry points of this codebase are called experiment*.jl

These files specify all parameters and algorithms used in each experiment. 
To run one, enter e.g., "julia -O3 -p16 experiment_sparse1.jl". The option "-p16" distributes the simulation among 16 cores. 

Following is the description of what each file corresponds to:
| File name 					| 	Raw files for figures in paper |	Output name					|
| experiment.jl 				| 1, 2(a), and 2(b). 			   |	experiment.dat				|
| experiment_multiple_arms.jl 	| 3.							   |	experiment[arm number].dat	|
| experiment_varyB 				| 4(b).							   |	1_1varBexperiment[B].dat		|

Raw files for 4(a) can be produced by running experiment_varyB.jl with changing value of \epsilon in the file to either 0.5 or 0.7, and updating the output file name to 0_5var* or 0_7var*.

Executing an experiment script will generate the mentioned *.dat file(s) with the simulation output. 
Generating the plots is triggered by running the corresponding viz*.jl files. 

| 		Experiment file 			| 		Visualization file 			| 		Output file(s)				|
| experiment.jl						| viz_experiment.jl					| sample_complexity.pdf & mab.pdf	|
| experiment_multiple_arms.jl		| viz_experiment_multiple_arms.jl	| sc_MA.pdf							|
| experiment_varyB.jl				| viz_experiment_VaryB.jl			| sc_VB.pdf							|
