convol.dens: Convolution of two empirical distributions

Description Usage Arguments Value References Examples

View source: R/Quant_Poolingfuns.R

Description

The function calculates the convolution of two empirical distributions up to the value of cutoff (on the sum of two random variables).

Usage

1
convol.dens(ecdf1, ecdf2, N1, N2, cutoff)

Arguments

ecdf1

An ecdf that is the matrix output object from the function convol.dens() itself or from the function ecdf_pool(). The ecdf can be truncated up by cutoff.

ecdf2

An ecdf that is the matrix output object from the function convol.dens() itself or from the function ecdf_pool(). The ecdf can be truncated up by cutoff.

N1

The size of the empirical support of ecdf1.

N2

The size of the empirical support of ecdf2.

cutoff

Cutoff of the support of the resulting convolution distribution

Value

The function returns a matrix of three columns: The support of convolution distribution up to cutoff, empirical PMF and empirical CDF.

References

Liu T, Hogan JW, Daniels, MJ, Coetzer M, Xu Y, Bove G, et al. Improved HIV-1 Viral Load Monitoring Capacity Using Pooled Testing with Marker-Assisted Deconvolution. Journal of AIDS. 2017;75(5): 580-587.

Examples

1
2
3
4
experiment_1 <- ecdf_pool(c(0,1,2,4,4,4,4,5,0,9,87,12), cutoff = 8)
example_ecdf_pool <- ecdf_pool(round(runif(100, 0, 20)), cutoff = 18)
convol.dens(example_ecdf_pool$out, example_ecdf_pool$out, cutoff = 18)
convol.dens(experiment_1$out, experiment_1$out, cutoff = 8)

whitneysu/QuantitativePooledTesting documentation built on Feb. 2, 2021, 12:46 p.m.