dens: Density Plot: Univariate Case

View source: R/default-gen-dens.R

densR Documentation

Density Plot: Univariate Case

Description

dens is a generic function used to plot the density. The function invokes particular methods which depend on the class of the first argument. So the function plots density for univariate POT models.

Usage

dens(object, ...)

## S3 method for class 'uvpot'
dens(object, main, xlab, ylab, dens.adj = 1,
kern.lty = 2, rug = TRUE, plot.kernel = TRUE, plot.hist = TRUE,
hist.col = NULL, ...)

Arguments

object

A fitted object. When using the POT package, an object of class 'uvpot'. Most often, the return of the fitgpd function.

main

The title of the graphic. If missing, the title is set to "Density Plot".

xlab, ylab

The labels for the x and y axis. If missing, they are set to "Quantile" and "Density" respectively.

dens.adj

Numeric. The adjustment for the kernel density estimation in the density function. The default is 1.

kern.lty

The line type for the kernel density estimation. This corresponds to the "lty" option of the lines functions. The default is 2.

rug

Logical. Should we call the rug function? Default is TRUE.

plot.kernel

Logical. Should the kernel density estimate be plotted?

plot.hist

Logical. Should the histogram be plotted?

hist.col

The color to fill the histogram.

...

Other arguments to be passed to the plot function.

Details

The density plot consists of plotting on the same windows the theoretical density and a kernel estimation one. If the theoretical model is correct, then the two densities should be “similar”.

Value

A graphical window.

Author(s)

Mathieu Ribatet

See Also

dens, dens.uvpot

Examples

x <- rgpd(75, 1, 2, 0.1)
pwmu <- fitgpd(x, 1, "pwmu")
dens(pwmu)

POT documentation built on Oct. 17, 2024, 5:06 p.m.