Issues on Fitting Univariate and Multivariate Hyperbolic Distributions Thomas Tran PhD student Department of Statistics University of Auckland thtam@stat.auckland.ac.nz Fitting Hyperbolic Distributions
Acknowledgement I am grateful my supervisor for his guidance The financial assistance of my department and the workshop organizers is highly appreciated Fitting Hyperbolic Distributions 1
Outline Generalized inverse Gaussian distributions, normal meanvariance mixture distributions, generalized hyperbolic distributions, hyperbolic distribution Fitting the univariate hyperbolic distribution using functions in the HyperbolicDist package EM and MCECM algorithms Fitting multivariate generalized hyperbolic distributions Fitting Hyperbolic Distributions 2
Grounding work: References Barndorff-Nielsen, O. E (1977) Exponentially decreasing distributions for the logarithm of particle size, Proceeding of the Royal Society. London. Series. A, 353, 401 419. Barndorff-Nielsen, O. E and Blæsild, P (1981) Hyperbolic distributions and ramifications: Contributions to theory and application. In C. Taillie, G. Patil and B. Baldessari (Eds), Statistical Distributions in Scientific work, vol.4 Dordreacht:Reidel Blæsild, P (1981) The two-dimensional hyperbolic distribution and related distributions, with an application to Johannsen s Bean Data, Biometrika, vol. 68 251 263 Fitting Hyperbolic Distributions 3
Dempster, A.P., Laird, N.M. and Rubin, D.B.(1977). Maximum likelihood from incomplete data via the EM algorithm(with discussion). J. Roy. Statist. Soc, Ser B 39 1-38. Recently, among others: Barndorff-Nielsen, O. E. Normal inverse Gaussian distributions and stochastic volatility modeling. Scand. J. Statist 24:1-13, 1997. Bibby, B. M. and Sørensen, M. (2003) Hyperbolic processes in finance. In Handbook of Heavy Tailed Distributions in Finance, Elsevier Science B. V. pp. 211 248. Eberlein, E. and Keller, U. (1995) Hyperbolic distributions in Finance. Bernoulli 1 281 299 Prause, K. (1999) The Generalized Fitting Hyperbolic Distributions 4
Hyperbolic Model: Estimation, Financial Derivatives, and Risk Measures. Ph.D. Thesis, Universität Freiburg. Practical work Practical work Blæsild, P. and Sørensen, M.(1992). hyp -a computer program for analyzing data by means of the hyperbolic distribution. Research Report 248, Department of Theoretical Statistics, University of Aarhus. McNeil, A. J., Frey, R., and Embrechts, P. (2005). Quantitative Risk Management: Concepts, Techniques and Tools. Princeton University Press, Princeton. The R package HyperbolicDist, QRMlib and others Fitting Hyperbolic Distributions 5
Generalized Inverse Gaussian distributions h(w λ, χ, ψ) = E(W α ) = (ψ/χ)λ/2 2 K λ ( ψχ) wλ 1 exp ( χ )α 2 K λ+α ( χψ) ψ K λ ( χψ) ( 1 2 ( ψw 1 + ψw )) Where w > 0, χ > 0 and ψ > 0 K λ denotes the modified Bessel function of the third kind with order λ Representable in 4 parameterizations with λ specifies the order of the modified Bessel function. The skewness and kurtosis parameters can be: (χ, ψ), (δ, γ), (α, β), (ω, ζ). Function gigchangepars Fitting Hyperbolic Distributions 6
Normal Mean-Variance Mixtures distributions Univariate generalized hyperbolic distribution f(x) = 0 1 (2π) 1 2w 1 2 [ exp Multivariate generalized hyperbolic distribution ] (x M )2 h(w)dw 2w g(x) = 0 1 (2π) d 2 Σ 1 2w d 2 [ exp (x M ) Σ 1 (x M ) ] h(w)dw 2w where Σ = AA and Σ has rank d. In both cases, M = µ + wγ and h(w) is the densisty of the generalized inverse Gaussian distribution Fitting Hyperbolic Distributions 7
Multivariate hyperbolic distribution From the mean-variance mixture, a multivariate generalized hyperbolic distribution can be derived ( [χ + (x µ) Σ 1 (x µ)][ψ + γ Σ 1 γ] ) g(x) = c K λ d 2 ( [χ + (x µ) Σ 1 (x µ)][ψ + γ Σ 1 γ] ) d 2 λ e(x µ) Σ 1 γ Where the normalizing constant is c = ( χψ) λ ψ λ (ψ + γ Σ 1 γ) d 2 λ (2π) d 2 Σ 1 2K λ ( χψ) If λ = d+1 2 we have a d-dimensional hyperbolic distribution. This is represented in the (λ, χ, ψ, Σ, γ, µ) parameterizations. The parameterizations suggested in Blæsild (1985) is (λ, α, δ,, β, µ) Fitting Hyperbolic Distributions 8
Univariate Generalized Hyperbolic Distributions Univariate generalized hyperbolic distribution f(x λ, α, β, δ, µ) = (γ/δ)λ 2πKλ (δγ) K λ 1/2 (α δ 2 + (x µ) 2 ) ( δ 2 + (x µ) 2 eβ(x µ) /α) 1/2 λ where K λ denotes the third modified Bessel function of order λ, γ 2 = α 2 β 2 and < x < Has 5 parameters Can be represented by 4 parameterizations All have λ, δ, µ as the order of the Bessel function, scale and location paramter respectively. The skewness and kurtosis parameters can be: (α, β), (ζ, ρ), (ξ, χ), and (ᾱ, β). Function ghypchangepars Fitting Hyperbolic Distributions 9
The Hyperbolic Distribution For µ= 0 and δ=1 the density of the hyperbolic distribution is 1 ( 2 ( ) exp ζ 1 + π 2 K 1 ζ [ 1 + π 2 1 + x 2 πx]) where K 1 denotes the modified Bessel function of third kind with index 1. Four different parameterizations. All have µ as location and δ as scale parameter. The skewness and kurtosis parameters can be (π, ζ); (α, β); (φ, γ); (ξ, χ) each parameterizations can be useful for different purposes. Function hyperbchangepars Fitting Hyperbolic Distributions 10
The Hyperbolic Distribution Shape Triangle 1.25 1.00 E L L E 0.75 ξ 0.50 GIG(1) GIG(1) 0.25 0.00 N 0.25 1.0 0.8 0.6 0.4 0.2 0.0 0.2 0.4 0.6 0.8 1.0 Plot of the log densities of different values of ξ and χ χ Fitting Hyperbolic Distributions 11
Fitting the Univariate Hyperbolic Distribution For fitting purpose of our talk we use the (π, ζ) parameterizations c(π, ζ, δ, µ) exp ζ ( ) 2 ( ) x µ 1 + π 1 x µ 2 + π δ δ where c(π, ζ, δ, µ) = [2δ ( ) ] 1 + π 2 1 K 1 ζ as in the (π, ζ) the only restriction is ζ > 0 Fitting Hyperbolic Distributions 12
Fitting the Univariate Hyperbolic Distribution hyperbfitstart(x, startvalues = "BN", startmethodsl = "Nelder-Mead", startmethodmom = "Nelder-Mead",...) This function returns 4 different starting values for the optimization process carried out by the hyperbfit function. BN: Barndorf Neilsen 1977 SL: Fitted Skewed Laplace FN: Fitted normal MoM: Method of Moment US: User supplied Fitting Hyperbolic Distributions 13
Fitting the Univariate Hyperbolic Distribution Fitting functions: hyperbfit(x, startvalues = "BN", method = "Nelder-Mead",... Nelder-Mead: A non-derivative optimization method suggested by Nelder and Mead (1965) BFGS: A derivative optimization method pioneered by Broyden- Fletcher-Goldfarb-Shanno Fitting Hyperbolic Distributions 14
Fitting the Univariate Hyperbolic Distribution Three questions raised in Barndorff-Nielsen and Blæsild (1981) regarding to: Sample size? Parameterization? Fitting methods? Eberlein and Keller (1985): Daily returns of 10 out of 30 of the DAX from 2 October 1989 to 30 September 1992, 745 data points Fitting Hyperbolic Distributions 15
Fitting the Univariate Hyperbolic Distribution Xi fitting Chi fitting ξ^ ξ 0.4 0.2 0.0 0.2 0.4 ξ = 0.3χ = 0.04 χ^ χ 0.15 0.05 0.00 0.05 0.10 0.15 ξ = 0.3χ = 0.04 Xi fitting Chi fitting ξ^ ξ 0.4 0.2 0.0 0.2 0.4 ξ = 0.3χ = 0.04 χ^ χ 0.15 0.05 0.00 0.05 0.10 0.15 ξ = 0.3χ = 0.04 Fitting Hyperbolic Distributions 16
Fitting the Univariate hyperbolic distribution Xi fitting Chi fitting ξ^ ξ 0.4 0.2 0.0 0.2 0.4 ξ = 0.6χ = 0.04 χ^ χ 0.15 0.05 0.00 0.05 0.10 0.15 ξ = 0.6χ = 0.04 Xi fitting Chi fitting ξ^ ξ 0.4 0.2 0.0 0.2 0.4 ξ = 0.6χ = 0.04 χ^ χ 0.15 0.05 0.00 0.05 0.10 0.15 ξ = 0.6χ = 0.04 Fitting Hyperbolic Distributions 17
Fitting the Univariate hyperbolic distribution Xi fitting Chi fitting ξ^ ξ 0.2 0.1 0.0 0.1 0.2 ξ = 0.98χ = 0.9 χ^ χ 0.15 0.05 0.00 0.05 0.10 0.15 ξ = 0.98χ = 0.9 Xi fitting Chi fitting ξ^ ξ 0.2 0.1 0.0 0.1 0.2 ξ = 0.98χ = 0.9 χ^ χ 0.15 0.05 0.00 0.05 0.10 0.15 ξ = 0.98χ = 0.9 Fitting Hyperbolic Distributions 18
Fitting the Univariate hyperbolic distribution Xi fitting Chi fitting ξ^ ξ 0.2 0.1 0.0 0.1 0.2 ξ = 0.98χ = 0.9 χ^ χ 0.15 0.05 0.00 0.05 0.10 0.15 ξ = 0.98χ = 0.9 Xi fitting Chi fitting ξ^ ξ 0.2 0.1 0.0 0.1 0.2 ξ = 0.98χ = 0.9 χ^ χ 0.15 0.05 0.00 0.05 0.10 0.15 ξ = 0.98χ = 0.9 Fitting Hyperbolic Distributions 19
Conclusions on fitting Univariate Hyperbolic Distribution None of the methods outperforms one another Better fit when sample size becomes larger. The fairly large sample size is about 2000 or more observations The fitting of ξ appears to be fairly accurate even with small sample size when the hyperbolic distributions are at the left and right boundary of the shape triangle is notable Fitting Hyperbolic Distributions 20
Expectation - Maximization algorithm Proposed by Dempster et al. (1977). If we were able to have a complete data Y we wish L(θ Y ) logf(y θ) θ Θ R d We assume Y = (Y obs, Y mis ). Each iteration of the EM algorithm comprises of two steps E and M. The (t + 1 )st E-step finds: Q(θ θ (t) ) = L(θ Y )f(y mis Y obs, θ = θ (t) )dy mis = E[L(θ Y ) Y obs, θ = θ (t) ] The (t + 1 )st M-step then finds θ (t+1) that maximizes Q(θ (t+1) θ (t) ) Q(θ θ (t) ) θ Θ Fitting Hyperbolic Distributions 21
Fitting the Multivariate Hyperbolic Distribution The complete data Y can also be thought of as the augmented data Y aug. The (t + 1 ) E step can be written as: Q(θ θ (t) ) = E[L(θ Y aug ) Y obs, θ = θ (t) ] We augmented the data to fit our model which is f(x θ = λ, χ, ψ, µ, Σ, γ). Using the mean variance mixture feature we could also alter our model to fit the data by partitioning θ = (θ 1, θ 2 ) where: θ 1 = (µ, Σ, γ) θ 2 = (λ, χ, ψ) Fitting Hyperbolic Distributions 22
Fitting the Multivariate Hyperbolic Distribution We could construct the augmented log likelihood ln [L(θ X 1... X n, W 1... W n )] = + n ln (f X W X i W i ; θ 1 ) (1) i=1 n ln (h W W i ; θ 2 ) (2) i=1 E step. We calculate Q(θ; θ t ) = E[ln L(θ; X 1,..., X n, W 1,..., W n X 1,..., X n ; θ t )] M step. Q(θ (t+1) θ (t) ) Q(θ θ (t) ) Fitting Hyperbolic Distributions 23
Fitting the Multivariate Hyperbolic Distribution In practice the calculation of(t + 1 )st E step reduces to find the values of the following quantities: δ [t] i = E[W 1 i X i ; θ [t] ] η [t] i = E[W i X i ; θ [t] ] Where W i X i follows a GIG with; ζ [t] i = E[ln(W i ) X i ; θ [t] ] λ = λ 1 2 d χ = (X i µ) Σ 1 (X i µ) + χ ψ = ψ + γ Σ 1 γ Fitting Hyperbolic Distributions 24
Fitting the Multivariate Hyperbolic Distribution In the M step we maximize the augmented log likelihood by maximizing each of its two components Q 1 (µ, Σ, γ; θ [t] 1 ) and Q 2 (λ, χ, ψ; θ [t] 2 ) separately. Q 1 can be maximized analytically as the first derivative of Q 1 wrt each parameter can be achieved in closed form Q 2 must be evaluated numerically Fitting Hyperbolic Distributions 25
MCECM algorithm Meng and Rubin (1993) proposed a variant of the EM called MCECM algorithm. At (t)th iteration The E step remains the same as with the EM algorithm The maximization method for Q 1 is unchanged and carried out first. This results in (θ [t+1] 1 = µ [t+1], Σ [t+1], γ [t+1] ) Q 2 is then numerically maximized as Q 2 (λ, χ, ψ; θ [t] 2, θ[t+1] 1 ). Compared with the calculation of Q 2 in the EM algorithm, it is now included θ [t+1] 1 Fitting Hyperbolic Distributions 26
Results and conclusions Comparison of convergence speed between EM and MCECM algorithm for 4 dimensional hyperbolic distribution conv.code loglik number.iter MCECM.BFGS 0 12545.18 75.00 MCECM.NM 0 12545.18 75.00 EM.BFGS 0 12546.14 88.00 EM.NM 0 12546.14 88.00 The MCECM appears to converge faster than the EM The estimation of λ causes both algorithms become unstable Fitting Hyperbolic Distributions 27
Results var 1 0 20 40 60 5 0 5 10 15 20 25 0 20 40 60 var 2 5 0 5 10 15 20 25 10 0 10 20 30 10 0 10 20 30 var 3 Generated data Fitting Hyperbolic Distributions 28
Results var 1 20 0 20 40 60 80 100 0 10 20 30 40 20 0 20 40 60 80 100 var 2 0 10 20 30 40 0 20 40 60 0 20 40 60 var 3 Fitted data Fitting Hyperbolic Distributions 29