Description Usage Arguments Details Value Examples
Creates a distrFunc object from a distribution name. The density/mass (func='d'
),
the cumulative distribution (func='p'
) and the quantile distribution (func='q'
) function
are possible choices.
1 2 3 4 5 6 |
type |
character: distribution name |
... |
further parameters depending on the distribution |
func |
character: type of function (default: |
discrete |
logical: if distribution is discrete or not (default:
|
supp |
range: the support of the distribution function (default: |
xlim |
range: set the range of the non-zero density/mass function
(default: |
ylim |
range: set the range of the y-values
(default: |
tol |
numeric: tolerance value (default:
|
pretty |
logical: use the function |
The standard distributions from the stats package (except the multinomial distribution) are supported
beta | beta distribution |
binom | binomial (including Bernoulli) distribution |
cauchy | Cauchy distribution |
exp | exponential distribution |
f | F distribution |
gamma | gamma distribution |
geom | geometric distribution |
hyper | hypergeometric distribution |
lnorm | log-normal distribution |
nbinom | negative binomial distribution |
norm | normal distribution |
pois | Poisson distribution |
t | Student's t distribution |
unif | uniform distribution |
weibull | Weibull distribution |
The function computes the range of the non-zero density/mass function and the maximum of the density/mass function.
For a standard distribution of the stats package you need only
to provide the name in the parameter type
. For a non-standard distribution with
the name 'wwww' is expected that the following functions exist:
dwwww(x, ...) | density/mass function |
pwwww(q, ...) | distribution function |
qwwww(p, ...) | quantile function |
A discrete distribution must be defined for non-negative integers.
The range of non-zero density/mass function is computed by qwwww(0,
...)
and qwwww(1, ...)
. If any of these quantiles returns
plus/minus infinity then qwwww(tol, ...)
or qwwww(1-tol, ...)
is used. Alternatively you may set the range by the parameter xlim
and a NA
value implies the quantile function should be used.
a distribution object
1 2 | d <- distrFunc("norm")
d
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.