# \[ANN\] New package QuadraticFormsMGHyp

**URL:** https://discourse.julialang.org/t/ann-new-package-quadraticformsmghyp/37100
**Category:** Package Announcements
**Created:** [April 6, 2020, 9:26am UTC](https://discourse.julialang.org/t/ann-new-package-quadraticformsmghyp/37100 "2020-04-06T09:26:23Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![s-broda](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/s-broda/32/3946_2.png) [@s-broda](https://discourse.julialang.org/u/s-broda)
#### Post date: [April 6, 2020, 9:26am UTC](https://discourse.julialang.org/t/ann-new-package-quadraticformsmghyp/37100/1 "2020-04-06T09:26:23Z")

</div>

Dear all

I’m announcing the availability of [QuadraticFormsMGHyp.jl](https://github.com/s-broda/QuadraticFormsMGHyp.jl). The purpose of the package is to compute tail probabilities and partial moments of

L\equiv a\_0+\mathbf{a}^{\mathrm{\scriptscriptstyle T}}X+X^{\mathrm{\scriptscriptstyle T}}\mathbf{A}X,

where X\sim \mathrm{MGHyp}(\boldsymbol{\mu},\mathbf{C},\boldsymbol{\gamma},\lambda,\chi,\psi); i.e., X has a d-variate generalized hyperbolic distribution with stochastic representation

X=\boldsymbol{\mu}+Y \boldsymbol{\gamma} +\surd{Y}\mathbf{C}Z,

where Z has a d-variate standard Normal distribution, \boldsymbol{\mu} and \boldsymbol{\gamma} are constant d-vectors, \mathbf{C} is a d\times d matrix, and Y has a univariate generalized inverse Gaussian distribution with density

f\_{GIG}(y;\lambda,\chi,\psi)\propto y^{\lambda-1}\exp\left\{-\frac{1}{2}\left(\chi y^{-1}+\psi y\right)\right\}.

The generalized hyperbolic distribution contains as special cases, among others, the Variance-Gamma (\lambda\>0), Student’s t (\lambda=-\nu/2, \chi=\nu, \psi=0), Normal Inverse Gaussian (\lambda=-1/2), and Hyperbolic (\lambda=1) distributions.

The package provides exact calculations and saddlepoint approximations. The algorithms are from [our paper](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3369208) and generalize those of Imhof (Biometrika, 1961) and Broda (Mathematical Finance, 2012).

Cheers  
Simon

---

<div class="post-metadata">

### Author: ![Albert\_Zevelev](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albert_zevelev/32/11844_2.png) [@Albert\_Zevelev](https://discourse.julialang.org/u/Albert_Zevelev)
#### Post date: [April 6, 2020, 6:49pm UTC](https://discourse.julialang.org/t/ann-new-package-quadraticformsmghyp/37100/2 "2020-04-06T18:49:32Z")

</div>

Thanks this package. Looks really cool!  
Have you considered adding it (or a subset) to [Distributions](https://github.com/JuliaStats/Distributions.jl/tree/master/src/multivariate).jl at some point?  
An advantage of it being part of a larger (well maintained) organization is that if the original developer stops updating it (or gets hit by a bus) it is still likely to be available to more potential users…

---

<div class="post-metadata">

### Author: ![s-broda](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/s-broda/32/3946_2.png) [@s-broda](https://discourse.julialang.org/u/s-broda)
#### Post date: [April 9, 2020, 10:43am UTC](https://discourse.julialang.org/t/ann-new-package-quadraticformsmghyp/37100/3 "2020-04-09T10:43:19Z")

</div>

Thanks! I’m not sure it’s a good fit with what Distributions.jl is aiming to do. I’ll think about it 🙂
