# Subsampling Potential Patient Populations

While the `vpop`

function returns a `VirtualPopulation`

ensemble of parameter values which correspond to relatively good fits to the data, in many cases this return is referred to as a "potential patient population", i.e. a set of potentially good parameters which may or may not reflect the statistical effects of the population. For example, say that for the data series that is being fit to, 50% of the population known to be fast matabolizers and 50% being slow matabolizers (characterized by some parameter or measurement in the model). The virtual population technique will return `N`

potential patients but there is no guarentee that macro statistical quantities are held. The purpose of the `subsample`

algorithm is to downsample from `N`

to `M`

to find a subpopulation which is more statistically represented by the resulting parameter set.

Missing docstring for `subsample`

. Check Documenter's build log for details.

## Subsampling Algorithms

`JuliaSimModelOptimizer.ARM`

— Type`ARM(; data::DataFrame, save_names, bw=fill(0.5, length(save_names)), N_neighbors::Int=5)`

The Allen-Reiger-Musante (ARM) subsampling technique.

**References**

Allen RJ, Rieger TR, Musante CJ. Efficient Generation and Selection of Virtual Populations in Quantitative Systems Pharmacology Models. CPT Pharmacometrics Syst Pharmacol. 2016 Mar;5(3):140-6. doi: 10.1002/psp4.12063. Epub 2016 Mar 17. PMID: 27069777; PMCID: PMC4809626.

`JuliaSimModelOptimizer.MAPEL`

— Type`MAPEL(; binning, reference_weights)`

The Mechanistic Axes Population Ensemble Linkage (MAPEL) algorithm for prevalence reweighing of a potential patient population to subsample to a virtual population. Uses a binning function with reference weights to choose a subsample of the potential patient population which bins with the same frequency as the reference.

**Keyword Arguments**

`binning`

: A function`binning(sol)`

which returns an integer representing the bin the patient applies to.`reference_weights`

**References**

Schmidt BJ, Casey FP, Paterson T, Chan JR. Alternate virtual populations elucidate the type I interferon signature predictive of the response to rituximab in rheumatoid arthritis. BMC Bioinformatics. 2013 Jul 10;14:221. doi: 10.1186/1471-2105-14-221. PMID: 23841912; PMCID: PMC3717130.