reconhub / distcrete

:chart_with_upwards_trend::point_right::bar_chart: Discretise distributions
http://reconhub.github.io/distcrete
Other
5 stars 1 forks source link

Add @details to core function #19

Open stephlocke opened 6 years ago

stephlocke commented 6 years ago

Needs to be sufficiently latex'd for render - iteration in a688070a7d61b8e06fb38b7d58c1e481f89c6f29 did not pass CRAN but did pass various checks

- $x_c$: a random variable with a known continous distribution, with $f_c$ its p.d.f and $F_c$ the corresponding c.d.f.
- $x_d$: a random variable following a discrete distribution derived from 'f_c'

The p.m.f. of $x_d$ is defined for any discrete value $X$ by:
$$
p(x_d = X) = p(x_c \in [X - (wi/2) ; X + (wi/2)[) = F_c(X + wi/2) - F_c(X - wi/2)
$$
where $i$ is the width of the discretising interval, and $w$ is an offset describing how continuous values are mapped onto a discrete scale. For instance, with $i = 1$ and $w = 0.5$, any values on $[2.5 ; 3.5[$ are mapped to 2; for $i = 1$ and $w = 0$, any values on $[1 ; 2[$ is mapped to $1$.