MergeTailHistogram: Utility function to merge tails in the histogram

Description Usage Arguments Value Examples

Description

Utility function to merge data points in the tails of the histogram.

Usage

1
MergeTailHistogram(q, merge_tails)

Arguments

q

In the form of list( qhx = h$mids, qhy = h$counts ) where h is a histogram

merge_tails

Number of data points to merge on each side, in the form of c(left, right)

Value

Modified q after the merge

Examples

1
2
3
4
5
  # Load the daily log-return data of DJIA 
  data(dji_logr)
  h <- hist(dji_logr, breaks = 60, plot = FALSE)
  # Merge two data points from the left tail, and one data points from the right tail
  q2 <- MergeTailHistogram( list(qhx=h$mids, qhy=h$counts), c(2,1) )

LIHNPSD documentation built on May 2, 2019, 9:12 a.m.