plus-.dist: Method for adding 'dist' objects, or shifting a distribution...

+.distR Documentation

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 class 'dist'
x + y

Arguments

x

A dist object or numeric scalar

y

A dist object or numeric scalar

Value

A simplified distribution or edist if no closed form exists

Examples

# Sum of two normals simplifies to a normal
z <- normal(0, 1) + normal(2, 3)
z  # Normal(mu = 2, var = 4)

# Shift a distribution by a constant
normal(0, 1) + 5  # Normal(mu = 5, var = 1)

algebraic.dist documentation built on Feb. 27, 2026, 5:06 p.m.