cdfplot-methods: Plot sets of cumulative density functions for 'LuckModel'...

Description Usage Arguments Details Value Author(s) See Also Examples

Description

This function plots the prior or posterior set of cumulative distribution functions represented by a LuckModel. It is currently implemented for one-dimensional distributions only. To represent the set of distributions, a pointwise mininum curve and pointwise maximum curve is plotted, i.e., for each x, min F(x) and max F(x) are calculated and drawn for a range of x values, and the area between them can be colored or shaded.

Usage

1
2
cdfplot(object, xvec = 100, epsilon = 1e-5, control = controlList(),
        ylim = c(0,1), vertdist = TRUE, ...)

Arguments

object

An object of a class extending LuckModel, i.e. representing inference for data from a certain distribution, e.g., ScaledNormalLuckModel. (Plain LuckModel objects implement the general superstructure for canonical conjugate priors and thus do not specify a certain parametric family of priors.)

xvec

Either a sequence to plot over or the number of points to plot over, with default = 100. In the first case, xvec must be a vector of ascending values, in the latter, a positive integer larger than 2. If xvec is an integer, cdfplot() determines the plotting region by calculating the union of highest density intervals (see unionHdi), covering a probability of 1-epsilon (see below). The plotting points are then evenly distributed over the resulting interval.

epsilon

1-epsilon is the coverage probability by which the plotting region is determined if xvec is an integer (see above). Defaults to 1e-5. Ignored if xvec is a vector.

control

A list of controls to address options for appearance of the plot. Default is the value of controlList(), a function that returns a list containing the required elements with their default value. The function controlList is described in detail in plot. Relevant options are posterior (defaulting to FALSE), and the options for appearance of the filled or shaded area (polygonCol, borderCol, density, angle). Other arguments for controlList are currently ignored.

ylim

Vector with two elements giving the limit of the plotting region for the ordinate (y axis), as in usual plots (see, e.g., par).

vertdist

If the cdfs of the distributions corresponding to the four corners of the parameter set should be plotted. Defaults to TRUE.

...

Further arguments forwarded to plot and polygon.

Details

The minimum and maximum cdf curve drawn by this function are pointwise, i.e., for each x, min F(x) and max F(x) over the set of parametric distributions are calculated and drawn for a range of x values. The resulting curves usually do not correspond to a single parametric distribution from the set of distributions, but for certain sets, this may nevertheless be the case. An example for the former case is the prior plot for a ScaledNormalLuckModel with both n^(0) and y^(0) interval-valued; an example for the latter case is the prior plot for a ScaledNormalLuckModel where n^(0) is fixed and y^(0) interval-valued (see the examples below). Comparison with the cdfs corresponding to the distributions in the four corners of the parameter set (drawn with option vertdist = TRUE) may serve to illustrate this.

The function relies on the function singleCdf, which, for an object of a concrete subclass of LuckModel, returns values of the cdf for a single distribution of the prior's parametric family.

Value

The function is used for its side effects (the plot).

Author(s)

Gero Walter

See Also

luck for a general description of the package, singleCdf for the cdf of a single distribution.

Examples

1
2
3
4
5
6
scn1 <- ScaledNormalLuckModel(n0=c(2,10), y0=c(3, 4), data=ScaledNormalData(mean=mean(rnorm(5)), n=5))
cdfplot(scn1)
scn2 <- ScaledNormalLuckModel(n0=2, y0=c(3, 4))
cdfplot(scn2, xvec=200)
cdfplot(scn1, control=controlList(posterior=TRUE, polygonCol=NA), vertdist=FALSE)
cdfplot(scn1, xvec=seq(2,5,by=0.01))

luck documentation built on May 2, 2019, 4:43 p.m.