Plot distributions fitted with linear moments

Share:

Description

Plot histogram and distribution densities or ecdf with cumulated probability

Usage

1
2
3
4
5
6
7
8
distLplot(dlf, nbest = 5, selection = NULL, order = FALSE, cdf = FALSE,
  log = FALSE, percentline = NA, percentargs = NULL, supportends = TRUE,
  breaks = 20, xlim = extendrange(dlf$dat, f = 0.15), ylim = NULL,
  xaxs = "i", yaxs = "i", xaxt, col = "grey", main, xlab, ylab, las = 1,
  coldist = berryFunctions::rainbow2(nbest), lty = 1, add = FALSE,
  logargs = NULL, legend = TRUE, legargs = NULL, histargs = NULL,
  qlines = FALSE, qheights = stats::quantile(par("usr")[3:4], 0.2),
  qrow = NULL, qlinargs = NULL, ...)

Arguments

dlf

List as returned by distLfit, containing the elements dat, parameter, gof, datname, gofProp

nbest

Number of distributions plotted, in order of goodness of fit. DEFAULT: 5

selection

Names of distributions in dlf$parameter that will be drawn. Overrides nbest. DEFAULT: NULL

order

If selection is given, should legend and colors be ordered by gof anyways? DEFAULT: FALSE

cdf

If TRUE, plot cumulated DF instead of probability density. DEFAULT: FALSE

log

If TRUE, logAxis is called. DEFAULT: FALSE

percentline

If TRUE, draw vertical line at 1-dlf$gofProp of dlf$dat. If NA, only do so if gofProp!=1. DEFAULT: NA

percentargs

List of arguments passed to abline. DEFAULT: NULL

supportends

If TRUE, dots are placed at the support bounds. DEFAULT: TRUE

breaks

hist breaks. DEFAULT: 20

xlim

hist or ecdf xlim. DEFAULT: extendrange(dat, f=0.15)

ylim

hist or ecdf ylim. DEFAULT: NULL

xaxs, yaxs

hist or ecdf xaxs and yaxs. DEFAULT: both "i"

xaxt

par xaxt. "n" suppresses axis and numbers, which is used if log

col

hist bar color or ecdf point color. DEFAULT: "grey"

main, xlab, ylab

hist or ecdf main, xlab, ylab. DEFAULT: internal abstraction fom dlf$datname

las

Label Axis Style for orientation of numbers along axes. DEFAULT: 1

coldist

Color for each distribution added with lines. DEFAULT: rainbow2

lty

Line TYpe for plotted distributions. Recycled vector of length nbest. DEFAULT: 1

add

If TRUE, hist is not called before adding lines. This lets you add lines highly customized one by one. DEFAULT: FALSE

logargs

List of arguments passed to logAxis if log=TRUE. DEFAULT: NULL

legend

Should legend be called? DEFAULT: TRUE

legargs

List of arguments passed to legend except for legend and col. DEFAULT: NULL

histargs

List of arguments passed to hist or ecdf except for x, freq. DEFAULT: NULL

qlines

Should vertical lines marking the quantiles be added? Ignored if dlf does not contain the element quant. DEFAULT: FALSE

qheights

Coordinates of quantile line ends, recycled if necessary. DEFAULT: 20% of plot height.

qrow

Rowname(s) of dlf$quant that should be drawn instead of the nbest highest ranking distribution functions. 'q_gpd*' will select all the gpd fits, including gpa. qheights and coldist must then accordingly have at least 13 elements (or will be recycled). DEFAULT: NULL

qlinargs

Arguments passed to lines for qlines. DEFAULT: NULL

...

Further arguments passed to lines, like type, pch, ...

Details

By default, this plots density instead of CDF, because the distributions are easier to discern and tail behaviour is easier to judge visually. See also urlhttp://www.vosesoftware.com/vosesoftware/ModelRiskHelp/index.htm#Presenting_results/Cumulative_plots/Relationship_between_cdf_and_density_%28histogram%29_plots.htm

Value

dlf with coldist added, returned invisibly.

Author(s)

Berry Boessenkool, berry-b@gmx.de, Sept 2014

See Also

distLfit, distLextreme

Examples

1
 # See distLfit and distLquantile