+.dist: Method for adding dist objects, or shifting a distribution by a scalar.
Description
Creates an expression distribution and automatically simplifies to
closed form when possible (e.g., normal + normal = normal,
normal + scalar = normal with shifted mean).
Usage
# S3 method for dist
+(x, y)
Value
A simplified distribution or edist if no closed form exists
# Sum of two normals simplifies to a normalz <- normal(0, 1) + normal(2, 3)
z # Normal(mu = 2, var = 4)# Shift a distribution by a constantnormal(0, 1) + 5# Normal(mu = 5, var = 1)