[![INFORMS Journal on Computing Logo](https://INFORMSJoC.github.io/logos/INFORMS_Journal_on_Computing_Header.jpg)](https://pubsonline.informs.org/journal/ijoc)

# A Distribution-Free Sequential Selection Strategy: Data-Driven Optimal Allocation via Balancing Empirical Large Deviations

This archive is distributed in association with the [INFORMS Journal on
Computing](https://pubsonline.informs.org/journal/ijoc) under the [MIT License](LICENSE).

The software and data in this repository are a snapshot of the software and data
that were used in the research reported on in the paper 
[A Distribution-Free Sequential Selection Strategy: Data-Driven Optimal Allocation via Balancing Empirical Large Deviations](https://doi.org/10.1287/ijoc.2024.0895) by Ye Chen. 


## Cite

To cite the contents of this repository, please cite both the paper and this repo, using their respective DOIs.

https://doi.org/10.1287/ijoc.2024.0895

https://doi.org/10.1287/ijoc.2024.0895.cd

Below is the BibTex for citing this snapshot of the repository.

```
@misc{chen2026,
  author =        {Ye Chen},
  publisher =     {INFORMS Journal on Computing},
  title =         {A Distribution-Free Sequential Selection Strategy: Data-Driven Optimal Allocation via Balancing Empirical Large Deviations},
  year =          {2026},
  doi =           {10.1287/ijoc.2024.0895.cd},
  url =           {https://github.com/INFORMSJoC/2024.0895},
  note =          {Available for download at https://github.com/INFORMSJoC/2024.0895},
}  
```

## Description

This repository provides R code for the DDOA algorithm presented in the article. The code in this repository is independently developed by the author and is created and used solely for the purposes of this project.

Refer to the comments in the code for detailed explanation.


## Running

The R code is provided in the `src` folder. To run the code, set the true system performances using
```
m = c()
```
and set the `samplegenerator()` function according to the sampling distribution. For example, for normal sampling distributions, replace `samplegenerator()` with
```
rnorm()
```

## Results

The R code evaluates the probability of incorrect selection (1-PCS), as well as the proportion of the total budget allocated to each alternative. The numerical experiment results are provided in the `results` folder, which includes Figures 1-2 in the paper. 


## Replicating

The numerical experiments in the paper are entirely based on generated samples. To reproduce the reported results, set the true system performances and sampling distributions according to the specifications provided in the paper. 

In Figure 1, the true parameters are randomly generated. For example, Figure 1b illustrates the performance of DDOA under Bernoulli sampling distributions, where the true parameters are set as
```
set.seed(10)
m = runif(25, 0, 1)
```
and `samplegenerator(m[c], ...)` is replaced with 
```
as.numeric(rbinom(1, 1, m[c]))
```

In Figure 2, the alternatives are configured to reflect the characteristics of the corresponding practical application. For example, Figure 2b considers the lifetime of machines with heterogeneous components. Specifically, one component's lifetime follows the Weibull distribution, for which the parameters are set as
```
wbsc = c(rep(1.6, 30), seq(1.45, length=5, by=-0.15), 
         seq(0.8, length=15, by=-0.05))
wbsh = 5
```
The other component's lifetime follows the Exponential distribution, for which the parameters are set as
```
epmu = c(seq(0.25, length=25, by=0.03),
         seq(1, length=5, by=0.15), rep(1.6, 20))
```
The `samplegenerator()` function is defined as 
```
samplegenerator = function(ssize, sh=wbsh, sc, mu){
  z = NULL
  
  wbs = rweibull(ssize, sh, sc)
  eps = rexp(ssize, 1/mu)
  
  for(i in 1:ssize){
    z = c(z, min(wbs[i], eps[i]))
  }
  
  return(z)
}
```
and `samplegenerator(m[c], ...)` is replaced with
```
samplegenerator(1, sc=wbsc[c], mu=epmu[c])
```