[ANN] BulkAndTails.jl

Hello. I’ve just registered BulkAndTails.jl, which offers an interface for the seven-parameter Bulk-And-Tails (BATs) distribution in the style of Distributions.jl. BATs was recently introduced in Stein 2021 to model an entire univariate distribution when extremes (i.e., tails) are of interest. Traditional methods for extremes, such as Distributions.GeneralizedPareto or Distributions.GeneralizedExtremeValue, ignore the bulk (i.e., nonextremes) of the data, and separate analyses must be performed for the upper and lower tails. BATs is a model for the entire distribution with flexible behavior in both tails.

BATs has seven parameters (\kappa_0, \tau_0, \phi_0, \kappa_1, \tau_1, \phi_1, \nu) where the 0 subscript controls lower tail behavior and 1 subscript controls upper tail behavior. \kappa is a shape parameter controlling the tail behavior:

  • \kappa<0 \implies bounded tail
  • \kappa = 0 (defined by continuity) \implies Gaussian tail
  • \kappa>0 \implies heavy tail

\tau>0 and \phi are scale and location parameters, respectively. The BATs cdf is T_\nu(H_\theta(x)), where T_\nu is the student-t cdf with \nu degrees of freedom and H_\theta is a monotone-increasing function depending upon the other parameters besides \nu. Therefore the pdf is t_\nu(H_\theta(x)) H'_\theta(x) where t_\nu is the student-t pdf with \nu degrees of freedom.

Some other key features of BATs:

  • can behave like any three-parameter generalized Pareto distribution in either tail
  • closed form density (no unknown normalizing constant)
  • analytic density (with respect to argument x and seven parameters) on the interior of its support. We use ForwardDiff.jl and Ipopt.jl for maximum likelihood estimation.

Another dependency is Roots.jl for the quantile (and sampler) function. These dependencies will make absorption into Distributions.jl difficult, but again, the functions in this package match how functions in Distributions.jl are called. See the example file for a demonstration.

Thanks to @cgeoga for the initial implementation of this package and much assistance with learning Julia.

12 Likes

Are there no analytical expressions for the moments?

1 Like

Hey @tbeason ! No expressions for the moments here, and no guarantee that they will exist, as this family of distributions includes the student-t family, in particular the Cauchy distribution.

3 Likes