Fitting an amount of distribution families by given quantiles

Share:

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

1
2
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 TRUE the optim result will be printed (default value is TRUE).

tolConv

positive numerical value, the absolute convergence tolerance for reaching zero by fitting distributions get.norm.par will be shown.

fit.weights

numerical vector of the same length as a probabilities vector p containing positive values for weighting quantiles. By default all quantiles will be weighted by 1.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
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

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.