Handles scalar * dist, dist * scalar, and dist * dist.

# S3 method for class 'dist'
x * y

Arguments

x

first operand

y

second operand

Value

A simplified distribution or edist

Examples

# Scalar multiplication simplifies for normal
z <- 2 * normal(0, 1)
z  # Normal(mu = 0, var = 4)
#> Normal distribution (mu = 0, var = 4) 

# Product of two distributions yields an edist
w <- normal(0, 1) * exponential(1)
is_edist(w)  # TRUE
#> [1] TRUE