Skip to contents

Shift (the support of) a ddf distribution by the specified amount.

Usage

shift(dist, s, desc = NULL)

Arguments

dist

A ddf object, the distribution.

s

A number, the shift to be applied to the distribution.

desc

A character, the description for the shifted distribution. (optional)

Value

A ddf object, the shifted distribution.

Examples

# Distribution for a simple symmetric random walk with
# step size 1 of length 4, centered at 3 (instead of 0)
shift(conv_n(rademacher(), 4), 3)
#> 4-fold convolution of Rademacher distribution, shifted by 3 
#> 
#> Support:
#> [1] -1  1  3  5  7
#> 
#> Probabilities:
#> [1] 0.0625 0.2500 0.3750 0.2500 0.0625