Learn R Programming

ghyp (version 1.1.0)

plot-lines-methods: Plot univariate generalized hyperbolic densities

Description

These functions plot probability densities of generalized hyperbolic distribution objects.

Usage

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

Arguments

x
An univariate ghyp object.
range
The range where the density will be computed. 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
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.

See Also

hist, qqghyp, pairs, plot, lines.

Examples

Run this code
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")

Run the code above in your browser using DataLab