plot-lines-methods: Plot univariate generalized hyperbolic densities

plot-lines-methodsR Documentation

Plot univariate generalized hyperbolic densities

Description

These functions plot probability densities of generalized hyperbolic distribution objects.

Usage

## S4 method for signature 'ghyp,missing'
plot(x, range = qghyp(c(0.001, 0.999), x), length = 1000, ...)
## S4 method for signature 'ghyp'
lines(x, range = qghyp(c(0.001, 0.999), x), length = 1000, ...)

Arguments

x

An univariate ghyp object.

range

The range over which the density will be plotted. The default is the range from the 0.1 % quantile to the 99.9 % quantile. When range has a length greater than 2 it is assumed to be the vector of quantiles and the density is computed on range.

length

The desired length of the density vector.

...

Arguments passed to plot and lines respectively.

Details

When the density is very skewed, the computation of the quantile may fail. See qghyp for details.

Author(s)

David Luethi

See Also

hist, qqghyp, pairs, plot, lines.

Examples

  data(smi.stocks)

  smi.fit   <-  fit.tuv(data = smi.stocks[,"SMI"], symmetric = TRUE)
  nestle.fit <- fit.tuv(data = smi.stocks[,"Nestle"], symmetric = TRUE)

  ## Student-t distribution
  plot(smi.fit, type = "l", log = "y")
  lines(nestle.fit, col = "blue")

  ## Empirical
  lines(density(smi.stocks[,"SMI"]), lty = "dashed")
  lines(density(smi.stocks[,"Nestle"]), lty = "dashed", col = "blue")

ghyp documentation built on Aug. 21, 2023, 5:12 p.m.