Change center and spread of distribution
form_recenter(f, to, method = "mean") form_respread(f, to, method = "sd", center_method = "mean")
f |
A pdqr-function. |
to |
A desired value of summary. |
method |
Method of computing center for |
center_method |
Method of computing center for |
form_recenter(f, to, method)
is basically a
f - summ_center(f, method) + to
: it moves distribution without affecting
its shape so that output distribution has center at to
.
form_respread(f, to, method, center_method)
is a following linear
transformation: coef * (f - center) + center
, where center
is
summ_center(f, center_method)
and coef
is computed so as to guarantee
output distribution to have spread equal to to
. In other words, this linear
transformation stretches distribution around its center until the result has
spread equal to to
(center remains the same as in input f
).
A pdqr-function describing distribution with desired center or spread.
my_beta <- as_d(dbeta, shape1 = 1, shape2 = 3) my_beta2 <- form_recenter(my_beta, to = 2) summ_center(my_beta2) my_beta3 <- form_respread(my_beta2, to = 10, method = "range") summ_spread(my_beta3, method = "range") ## Center remains unchainged summ_center(my_beta3)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.