rasubbo {Rsubbotools} | R Documentation |
Produces a random sample from a Asymmetric Power Exponential distribution
Description
Generate pseudo random-number from an asymmetric power exponential distribution
using the Tadikamalla method.
This version improves on Bottazzi (2004) by making the mass of each
distribution to depend on the ratio between the al
and the ar
parameters.
Usage
rasubbo(n, m = 0, al = 1, ar = 1, bl = 2, br = 2)
Arguments
n |
(int) - size of the sample. |
m |
(numeric) - location parameter. |
al , ar |
(numeric) - scale parameters. |
bl , br |
(numeric) - shape parameters. |
Details
The AEP distribution is expressed by the function:
f(x;a_l,a_r,b_l,b_r,m) =
\frac{1}{A} e^{- \frac{1}{b_l} |\frac{x-m}{a_l}|^{b_l} }, x < m
f(x;a_l,a_r,b_l,b_r,m) =
\frac{1}{A} e^{- \frac{1}{b_r} |\frac{x-m}{a_r}|^{b_r} }, x > m
with:
A = a_lb_l^{1/b_l}\Gamma(1+1/b_l) + a_rb_r^{1/b_r}\Gamma(1+1/b_r)
where m
is a location parameter, b*
are shape parameters, a*
are scale parameters and \Gamma
represents the gamma function.
By a suitably transformation, it is possible to use the EP distribution with
the Tadikamalla method to sample from this distribution. We basically take
the absolute values of the numbers sampled from the rpower
function,
which is equivalent from sampling from a half Exponential Power distribution.
These values are then weighted by a constant expressed in the parameters.
More details are available on the package vignette and on the
function rpower
.
Value
a numeric vector containing a random sample.
Examples
sample_gamma <- rasubbo(1000, 0, 0.5, 0.5, 1, 1)