rriskFitdist.perc {rriskDistributions} | R Documentation |
Fitting an amount of distribution families by given quantiles
Description
This function fits the amount of distribution families to given quantiles and returns diagnostics that allow user to choose a most appropriate probability.
Usage
rriskFitdist.perc(p = c(0.025, 0.5, 0.975), q = c(9.68, 29.20, 50.98),
show.output = TRUE, tolConv = 0.001, fit.weights = rep(1, length(p)))
Arguments
p |
numerical vector giving probabilities. |
q |
numerical vector giving percentiles. |
show.output |
logical, if |
tolConv |
positive numerical value, the absolute convergence tolerance for reaching zero by fitting distributions
|
fit.weights |
numerical vector of the same length as a probabilities vector
|
Details
Both inputs p
and q
should be of the same length. The items of
the probability vector p
should lie between 0 and 1.
Value
Returns a list containing the data frame with the input vectors p
and q
and the results matrix giving fitted distributions, estimated
parameters and a vector of theoretical percentiles calculated based on the
estimated parameters. If the consistency check of input parameters fails
the function returns NA
.
Author(s)
Matthias Greiner matthias.greiner@bfr.bund.de (BfR),
Kristin Tolksdorf kristin.tolksdorf@bfr.bund.de (BfR),
Katharina Schueller schueller@stat-up.de (STAT-UP Statistical Consulting),
Natalia Belgorodski belgorodski@stat-up.de (STAT-UP Statistical Consulting)
Examples
fit.results1 <- rriskFitdist.perc(show.output = FALSE)
fit.results1
fit.results2 <- rriskFitdist.perc(show.output = FALSE, tolConv = 0.6)
fit.results2
p <- c(0.2, 0.7)
q <- c(2.6, 19.1)
fit.results3 <- rriskFitdist.perc(p = p, q = q, show.output = FALSE)
fit.results3
p <- c(0.3, 0.8, 0.9)
q <- c(10, 20, 40)
fit.results4 <- rriskFitdist.perc(p = p, q = q, show.output = FALSE)
fit.results4
## Example with fitted pert distribution
p <- c(0.025, 0.5, 0.6, 0.975)
q <- mc2d::qpert(p = p, min = 0, mode = 3, max = 10, shape = 5)
fit.results5 <- rriskFitdist.perc(p = p, q = q, show.output = FALSE)
fit.results5