R6 class representing probability distributions for CCC analysis
An R6 class representing probability mass functions (PMF) with optimized operations for cell-cell communication analysis. Supports both discrete PMF arrays and normal distribution approximations.
Details
The Distribution class supports the following operations:
Addition: Sum of two independent random variables (FFT convolution)
Power: Sum of n i.i.d. random variables
Division: Average of n i.i.d. random variables
And (&): Special operation for L+R combination
Public fields
dtypeDistribution type: "normal" or "other"
locLocation parameter (mean for normal)
scaleScale parameter (sd for normal)
pmf_arrayPMF array
is_alignWhether PMF is aligned to standard bins
is_normal_typeWhether distribution is normal type
is_analyticWhether distribution has analytic CDF
is_complex_analyticWhether from complex combination
cdf_analytic_funcAnalytic CDF function (for normal)
min_cdf_non_zeroLower bound of support
min_cdf_oneUpper bound of support
support_lengthLength of support
ligandLigand distribution (for complex analytic)
receptorReceptor distribution (for complex analytic)
modeDistribution mode: "continuous" or "digit"
Methods
Method new()
Create a new Distribution object
Usage
Distribution$new(
dtype = "other",
loc = NULL,
scale = NULL,
samples = NULL,
pmf_array = NULL,
is_align = NULL,
mode = "continuous",
eps = 1e-04
)Method power()
Sum of n i.i.d. copies
Method mul_op()
Geometric mean of two distributions (sqrt(X*Y))