Given a distribution family, this function attempts to retrieve the distribution parameters and various characteristics, such as: valid parameter ranges, whether they accept non-integer values and the support of the distribution.
getParams(fam, package)
character or list.
If fam
is a list or a named vector,
then it has the two entries “package” and
“family”, e.g. list(package=“stats”, family=“beta”)
character. Optional argument if fam
is given.
In most cases the package can be determined by getParams
itself.
For getParams
a list with components, each of them a named vector: The
names are the arguments of the distribution family as specified in e.g. the
“r<distributionFamilyName>”-function, the value is described below:
named vector; values: numeric, lower bound of the respective parameter value
named vector; values: numeric, upper bound of the respective
parameter value. Length and names must coincide with entry lower
.
named vector; values: boolean, TRUE
if
respective parameter value is continuous, FALSE
if only
integers are accepted. Length and names must coincide with entry
lower
.
named vector; values: numeric, default values for the
respective parameter (needed for optimisation to work).
Length and names must coincide with entry lower
.
single boolean; TRUE
if log(probability) is provided by
d[family](), FALSE
if they are not. Generating
log-probabilities oneself may be numerically unstable.
single boolean; TRUE
if only integers are taken as
values, FALSE
otherwise.
single numeric; left bound of support of the distributions density, i.e. minimum value where the density is not zero.
single numeric; right bound of support of the distributions density, i.e. maximum value where the density is not zero.
named vector; value: booleans, TRUE
if
right support bound depends on the repective parameter,
FALSE
if not. Note that dependency is currently
implemented as equality between bound and parameter, linear
relationships may be implemented in the future. Length and
names must coincide with entry lower
.
named vector; value: booleans, TRUE
if
right support bound depends on the repective parameter,
FALSE
if not. See note in entry
supp_max_depends_on
. Length and names must coincide
with entry lower
.
The family name is defined as the part of the function name that follows “d”,
“p”, “q” and “r”. So in case of the continuous uniform
the family name is “unif”.
The values returned by getParams
are included
in the DistributionFitR-package and updated with each package update.
Users may use it to update the library of parameter characteristics
themselves or find the function useful to use the parameter
characteristics retrieved for other purposes.
See also getFamilies
for a convenient wrapper available to the
user where distributions are extracted from whole packages.
# NOT RUN {
getParams("beta", package = "stats")
getParams("unif", package = "stats" )
# }
Run the code above in your browser using DataLab