Create a ddf object for the Rademacher distribution with the given
parameters.
Details
The Rademacher distribution has support \(\{-1,1\}\) with both elements having probability \(\frac{1}{2}\) (that is, it is the discrete uniform distribution on \(\{-1,1\}\)).
It can be used to model simple symmetric random walks with step size 1, especially when being convolved with itself (compare the ‘Examples’).
See also
Other distributions:
benford(),
bernoulli(),
beta_binomial(),
bin(),
geometric(),
hypergeometric(),
negative_bin(),
negative_hypergeometric(),
pois(),
unif(),
zipf()
Examples
rademacher()
#> Rademacher distribution
#>
#> Support:
#> [1] -1 1
#>
#> Probabilities:
#> [1] 0.5 0.5
# Model a symmetric random walk starting at 0
# with step size 1 of length 4
conv_n(rademacher(), 4)
#> 4-fold convolution of Rademacher distribution
#>
#> Support:
#> [1] -4 -2 0 2 4
#>
#> Probabilities:
#> [1] 0.0625 0.2500 0.3750 0.2500 0.0625
