Skip to contents

[Experimental] This convolves any consecutive nonparametric distributions contained in the <dist_spec>.

Usage

# S3 method for class 'dist_spec'
collapse(x, ...)

Arguments

x

A <dist_spec>

...

ignored

Value

A <dist_spec> where consecutive nonparametric distributions have been convolved

Examples

# A fixed gamma distribution with mean 5 and sd 1.
dist1 <- Gamma(mean = 5, sd = 1, max = 20)

# An uncertain lognormal distribution with mean 3 and sd 2
dist2 <- LogNormal(mean = 3, sd = 2, max = 20)

# The maxf the sum of two distributions
collapse(discretise(dist1 + dist2))
#> - nonparametric distribution
#>   PMF: [2.6e-12 7.7e-07 0.00019 0.0036 0.024 0.08 0.16 0.2 0.19 0.14 0.086 0.051 0.029 0.017 0.01 0.006 0.0037 0.0023 0.0015 0.00097 0.00064 0.00043 3e-04 2e-04 0.00014 8e-05 3.4e-05 9.7e-06 1.8e-06 2.4e-07 2.3e-08 1.8e-09 1.1e-10 5.4e-12 2.4e-13 9e-15 2.9e-16 -4.1e-18 -7.8e-18 -2.1e-17 -3.1e-17]