
Given the parameters of a unimodal distribution and the root of the density function name, this function determines the range outside of which the density function is negligible, to a specified tolerance.
distCalcRange(densFn, param = NULL, tol = 10^(-5), ...)
A two-component vector giving the lower and upper ends of the range.
Character. The name of the density function for which range calculation is required.
Tolerance.
Numeric. A vector giving the parameter values for the
distribution specified by densFn
. If no param
values
are specified, then the default parameter values of each
distribution are used instead.
Passes arguments to uniroot
.In
particular, the parameters of the distribution.
David Scott d.scott@auckland.ac.nz, Joyce Li xli053@aucklanduni.ac.nz
The name of the unimodal density function must be supplied as the
characters of the root for that density (e.g. norm
,
ghyp
). The particular unimodal distribution being considered is
specified by the values of the parameters or of the
param
vector.
The function gives a range, outside of which
the density is less than the given tolerance. It is used in
determining break points for the separate sections over which
numerical integration is used to determine the distribution
function. The points are found by using uniroot
on the
density function.
qDist
normRange <- distCalcRange("norm", tol = 10^(-7), mean = 4, sd = 1)
normRange
tRange <- distCalcRange("t", tol = 10^(-5), df = 4)
tRange
Run the code above in your browser using DataLab