Learn R Programming

rriskDistributions (version 2.1.1)

get.unif.par: Fitting parameters of a uniform distribution from two or more quantiles

Description

get.unif.par returns the parameters of a uniform distribution where the pth percentiles match with the quantiles q.

Usage

get.unif.par(p = c(0.025, 0.975), q, plot = TRUE, scaleX = c(0.1, 0.9), ...)

Arguments

p
numeric, single value or vector of probabilities.
q
numeric, single value or vector of quantiles corresponding to p.
plot
logical, if TRUE the graphical diagnostics will be plotted (default value is TRUE)
scaleX
numerical vector of the length 2 containing values (from the open interval (0, 1)) for scaling quantile-axis (relevant only if plot = TRUE). The smaller the left value, the further the graph is extrapolated within the lower percentile, the greater the right value, the further it goes within the upper percentile.
...
further arguments passed to the functions plot and points (relevant only if plot = TRUE)

Value

Returns fitted parameters of a uniform distribution.

Details

The number of probabilities and the number of quantiles must be identical and should be at least two. Using the default p, the three corresponding quantiles are the 2.5th percentile, the median and the 97.5th percentile, respectively. Parameters of the uniform distribution are estimated exactly. The items of the probability vector p should lie between 0 and 1.

Examples

Run this code
q <- stats::qunif(p = c(0.025, 0.975), min = 0, max = 5)
get.unif.par(q = q)
get.unif.par(q = q, scaleX = c(0.001, 0.999))

q <- stats::qunif(p = c(0.025, 0.975), min=-6, max = 5)
get.unif.par(q = q)

Run the code above in your browser using DataLab