Density, distribution function, quantile function and random generation for a number of univariate and multivariate distributions. This package implements the following distributions: Bernoulli, beta-binomial, beta-negative binomial, beta prime, Bhattacharjee, Birnbaum-Saunders, bivariate normal, bivariate Poisson, categorical, Dirichlet, Dirichlet-multinomial, discrete gamma, discrete Laplace, discrete normal, discrete uniform, discrete Weibull, Frechet, gamma-Poisson, generalized extreme value, Gompertz, generalized Pareto, Gumbel, half-Cauchy, half-normal, half-t, Huber density, inverse chi-squared, inverse-gamma, Kumaraswamy, Laplace, location-scale t, logarithmic, Lomax, multivariate hypergeometric, multinomial, negative hypergeometric, non-standard beta, normal mixture, Poisson mixture, Pareto, power, reparametrized beta, Rayleigh, shifted Gompertz, Skellam, slash, triangular, truncated binomial, truncated normal, truncated Poisson, Tukey lambda, Wald, zero-inflated binomial, zero-inflated negative binomial, zero-inflated Poisson.
Density, distribution function, quantile function and random generation for a number of univariate and multivariate distributions.
This package follows naming convention that is consistent with base R,
where density (or probability mass) functions, distribution functions,
quantile functions and random generation functions names are followed by
d
*, p
*, q
*, and r
* prefixes.
Behaviour of the functions mimics the base R, where for
invalid parameters NaN
's are returned, while
for values beyond function support 0's are returned
(e.g. for non-integers in discrete distributions, or for
negative values in functions with non-negative support).
All the functions vectorized and coded in C++ using Rcpp.
size
parameter.pbbinom
(#16). Additionally, this should make
pbbinom
and pbnbinom
faster when working with large vectors.dinvgamma
functiondnst
, pnst
, qnst
and rnst
were removedppower
: with lower.tail = FALSE
it returned wrong valuesdgpd
and pgpd
: they assumed slightly wrong supportrgev
and rgpd
, now they give better random values since
relying on exponential distribution random generator if possiblealpha > 0
and beta > 0
pinvgamma
(lower.tail
and log.p
didn't work)rmnom
and rdirmnom
(#7)*nst
functions are now deprecated and renamed to more informative
abbrevation *lst
rtnorm
(sampling from lower bound returned incorrect
values)pbnbinom
, pbbinom
, pgpois
functions are easier to brakepinvgamma
(it returned non-zero probabilities for
q < 0)rmnom
and rdirmnom
(issue #3) do not return NaN
's due to
underflow issuesrcatlp
?PropBeta
documentationpbbinom
, pbnbinom
, pgpois
, *nhyper
that
prevented compiling on RedHat Linux (#2)pbbinom
, pbnbinom
, pgpois
and
negative hypergeometric distribution that lead to major speed improvementslower.tail
and log.p
options for pbetapr
work properlydbvpois
(it returned underestimated probabilities),
dslash
(there was discontinuity at x=0), pcat
(randomly it broke
if x was greater then the upper limit), and pdnorm
.NA
's on NA
's in
parameters or incorrect parameters - as in base R*prop
distributionc(1,1,1)
becomes c(1,1,1)/3
)NA
's and NaN
's in input now always lead to NA
's in outputrtnorm
, now it properly handles sampling from extreme
tails1e-2
qtnorm
- now it works properly for
non-standard truncated normalrmnom
and rdirmnom
- now they correctly
use the prob
parameter valuesdmvhyper
and dbvpois
unif_rand
, norm_rand
) when possiblemin == max
discrete uniform distribution behaves now
as degenerate distribution<double>
's,
or casted to <double>
; or <int>
's (for indexing)erf
, erfc
, inv_erf
that are not used at this moment and
caused problems when compiling on Fedora and Solarisx
to q
for CDF'sNaN
instead of 0
for Inf
values)rtriang
rdunif
dbvnorm
and dbvpois
work with matrixespbbinom
and pbnbinom
*zip
and *zinb
*zib
pzipois
and pzibinom
qlgser
; changes in plgser
and rlgser
rlgser
dmvhyper
and rmvhyper
: values of x
, n
,
and k
are checked against being non-integers