Calculate highest density regions continously over some conditioned variable.
Source:R/plotcde.R
hdr.cde.Rd
Calculates and plots highest density regions for a conditional density
estimate. Uses output from cde
.
Arguments
- den
Conditional density in the same format as the output from
cde
.- prob
Probability coverage level for HDRs
- plot
Should HDRs be plotted? If FALSE, results are returned.
- plot.modes
Should modes be plotted as well as HDRs?
- mden
Marginal density in the
x
direction. When small, the HDRs won't be plotted. Default is uniform so all HDRs are plotted.- threshold
Threshold for margin density. HDRs are not plotted if the margin density
mden
is lower than this value.- nn
Number of points to be sampled from each density when estimating the HDRs.
- xlim
Limits for x-axis.
- ylim
Limits for y-axis.
- xlab
Label for x-axis.
- ylab
Label for y-axis.
- border
Show border of polygons
- font
Font to be used in plot.
- cex
Size of characters.
- ...
Other arguments passed to plotting functions.
Value
- hdr
array (a,b,c) where where a specifies conditioning value, b gives the HDR endpoints and c gives the probability coverage.
- modes
estimated mode of each conditional density