Learn R Programming

MLEcens (version 0.1-2)

plotCDF2: Create a bivariate CDF (or survival function) plot of the MLE

Description

This function plots the MLE for the bivariate CDF of (X,Y) (or the bivariate survival function). The value of the estimate at the point (x,y) is computed by summing all probability mass of the MLE that falls in the region (-infinity,x] x (-infinity,y]. The plot uses colors/shades to represent the value of the MLE, and is generated using the function image.

Usage

plotCDF2(mle, bound, col=gray(seq(0.9,0.3,len=30)), surv=FALSE, key=TRUE, 
         n.key=10, round.key=2, cex.key=0.6, xlim=NULL, ylim=NULL, zlim=NULL, 
         breaks=NULL, xlab="", ylab="", main="", sub="")

Arguments

mle
List with elements 'p' and 'rects', as outputted by computeMLE.
bound
Parameter taking the values "u" and "l". It indicates how representational non-uniqueness of the MLE should be handled. Option "u" (upper) indicates an upper bound, obtained by assigning all mass to the lower left corners of the maximal intersecti
col
Color vector used to represent the values of the MLE. The default value is gray(seq(0.9,0.3,len=30)).
surv
Logical. If FALSE, the bivariate CDF P(X
key
Logical, indicating if a color key should be drawn. The default value is TRUE.
n.key
Approximate number of tickmarks for the color key. The default value is 10.
round.key
Number of decimals used for the labels of the color key. The default value is 2.
cex.key
Numerical value giving the amount by which text in the key should be scaled relative to the default. The default value is 0.6.
xlim, ylim
Ranges for the plotted x and y values, defaulting to the ranges of the x- and y-coordinates of the relevant corners of the maximal intersections.
zlim
The minimum and maximum values of the estimate for which colors should be plotted, defaulting to the range of the finite values of the estimate. Each of the given colors will be used to color an equispaced interval of this range. The midpoints of
breaks
Numeric vector with break points for the colors, satisfying length(breaks)=length(col)+1. This parameter overrides zlim.
xlab, ylab
Labels for the x- and y-axis. The default values are empty.
main
Title of the plot. The default value is empty.
sub
Sub title of the plot. The default value is empty.

Value

  • No value is returned.

concept

  • nonparametric maximum likelihood estimator
  • censored data

See Also

computeMLE

Examples

Run this code
# Load example data:
data(ex)

# Compute the MLE:
mle <- computeMLE(ex)

# Bivariate CDF plot of the MLE:
#   Plot lower bound for representational non-uniqueness
par(mfrow=c(1,1))
plotCDF2(mle, xlim=c(min(ex[,1])-1,max(ex[,2])+1), 
 ylim=c(min(ex[,3])-1, max(ex[,4])+1), bound="l", n.key=4,
 main="Bivariate CDF plot of the MLE,
 lower bound")

#   Add observation rectangles and shaded maximal intersections
plotRects(ex, add=TRUE) 
plotRects(mle$rects, density=20, border=NA, add=TRUE) 

#   Plot upper bound for representational non-uniqueness
plotCDF2(mle, xlim=c(min(ex[,1])-1,max(ex[,2])+1), 
 ylim=c(min(ex[,3])-1, max(ex[,4])+1), bound="u", n.key=4,
 main="Bivariate CDF plot of the MLE,
 upper bound")

#   Add observation rectangles and shaded maximal intersections
plotRects(ex, add=TRUE)
plotRects(mle$rects, density=20, border=NA, add=TRUE)

Run the code above in your browser using DataLab