powered by
Calculates and plots highest density regions for a conditional density estimate. Uses output from cde.
cde
hdr.cde( den, prob = c(50, 95, 99), plot = TRUE, plot.modes = TRUE, mden = rep(1, length(den$x)), threshold = 0.05, nn = 1000, xlim, ylim, xlab, ylab, border = TRUE, font = 1, cex = 1, ... )
Conditional density in the same format as the output from cde.
Probability coverage level for HDRs
Should HDRs be plotted? If FALSE, results are returned.
Should modes be plotted as well as HDRs?
Marginal density in the x direction. When small, the HDRs won't be plotted. Default is uniform so all HDRs are plotted.
x
Threshold for margin density. HDRs are not plotted if the margin density mden is lower than this value.
mden
Number of points to be sampled from each density when estimating the HDRs.
Limits for x-axis.
Limits for y-axis.
Label for x-axis.
Label for y-axis.
Show border of polygons
Font to be used in plot.
Size of characters.
Other arguments passed to plotting functions.
array (a,b,c) where where a specifies conditioning value, b gives the HDR endpoints and c gives the probability coverage.
estimated mode of each conditional density
Hyndman, R.J., Bashtannyk, D.M. and Grunwald, G.K. (1996) "Estimating and visualizing conditional densities". Journal of Computational and Graphical Statistics, 5, 315-336.
cde, hdr
hdr
# NOT RUN { faithful.cde <- cde(faithful$waiting,faithful$eruptions) plot(faithful.cde,xlab="Waiting time",ylab="Duration time",plot.fn="hdr") # }
Run the code above in your browser using DataLab