Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Factor analysis for generalized hyperbolic distributions

Factor analysis replaces a full dispersion matrix by Σ=FF+D\Sigma=FF^\top+D, where FRd×rF\in\mathbb R^{d\times r}, r<dr<d, and DD is a positive-definite diagonal matrix. This reduces the covariance parameter count and gives a latent-factor representation. Related mixture models are studied by Tortora, McNicholas, and Browne in 2013, A Mixture of Generalized Hyperbolic Factor Analyzers. Here we derive the single-component GH factor model used in the pinned note.

Read GH distributions, batch EM, and the joint/marginal distinction first. Assume a,b>0a,b>0, independent observations, and the representation

X=μ+γY+Y(FZ+ε),YGIG(p,a,b),ZNr(0,Ir),εNd(0,D),\begin{aligned} X&=\mu+\gamma Y+\sqrt Y(FZ+\varepsilon),\\ Y&\sim\operatorname{GIG}(p,a,b),\quad Z\sim\mathcal N_r(0,I_r),\quad \varepsilon\sim\mathcal N_d(0,D), \end{aligned}

with Y,Z,εY,Z,\varepsilon mutually independent. ZZ denotes standard-normal factor noise; the scalar mixing variable YY is WW in the conditioning note. In one dimension, γ=β\gamma=\beta and Σ=σ2\Sigma=\sigma^2. The classical parameters are u=(μ,γ,F,D,p,a,b)u=(\mu,\gamma,F,D,p,a,b); θ(u)\theta(u) below denotes their natural-coordinate embedding.

Joint Distribution

The conditional distribution of XX given YY and ZZ is N(μ+γY+YFZ,DY)N(\mu + \gamma Y + \sqrt{Y} F Z, \, D Y). The joint distribution of (X,Y,Z)(X, Y, Z) is:

f(x,y,zμ,γ,F,D,p,a,b)=1(2π)d+rD(a/b)p/22Kp(ab)yp1d/2×exp ⁣(12zz12(by1+ay)12(xμγyFyz)D1(xμγyFyz)y1)\begin{aligned} &f(x, y, z | \mu, \gamma, F, D, p, a, b) \\ &= \frac{1}{\sqrt{(2\pi)^{d+r} |D|}} \frac{(a/b)^{p/2}}{2 K_p(\sqrt{ab})} y^{p - 1 - d/2} \\ &\quad \times \exp\!\left(-\frac{1}{2} z^\top z - \frac{1}{2}(b \, y^{-1} + a \, y) - \frac{1}{2}(x - \mu - \gamma y - F \sqrt{y} \, z)^\top D^{-1}(x - \mu - \gamma y - F \sqrt{y} \, z) \, y^{-1}\right) \end{aligned}

for y>0y > 0.

Curved Exponential Family

The density (2) belongs to a curved exponential family:

f(x,y,z)=h(x,y,z)exp ⁣(θ(u)t(x,y,z)ψ(θ(u))),f(x, y, z) = h(x, y, z) \exp\!\left(\theta(u)^\top t(x, y, z) - \psi(\theta(u))\right),

where θ()\theta(\cdot) is a nonlinear mapping from the parameter u=(μ,γ,F,D,p,a,b)u = (\mu, \gamma, F, D, p, a, b) to a higher-dimensional space.

The sufficient statistics t(x,y,z)t(x, y, z) consist of ten components:

s1=logy,s2=y1,s3=y,s4=x,s5=xy1,s6=xxy1,s_1 = \log y, \quad s_2 = y^{-1}, \quad s_3 = y, \quad s_4 = x, \quad s_5 = x y^{-1}, \quad s_6 = x x^\top y^{-1},
s7=xzy1/2,s8=zy1/2,s9=zy1/2,s10=zz.s_7 = x z^\top y^{-1/2}, \quad s_8 = z y^{-1/2}, \quad s_9 = z y^{1/2}, \quad s_{10} = z z^\top.

Log-Likelihood Function

With ss fixed as a complete-data average or a posterior average, the parameter-dependent part of the per-observation log likelihood is:

LFA(us)=12logD12μD1μs212γD1γs3+γD1s4+μD1s512tr(D1s6)+tr(FD1s7)μD1Fs8γD1Fs912tr(FD1Fs10)μD1γ+LGIG(p,a,bs1,s2,s3),\begin{aligned} L_{FA}(u | s) &= -\frac{1}{2} \log|D| - \frac{1}{2} \mu^\top D^{-1} \mu \, s_2 - \frac{1}{2} \gamma^\top D^{-1} \gamma \, s_3 + \gamma^\top D^{-1} s_4 + \mu^\top D^{-1} s_5 \\ &\quad - \frac{1}{2} \operatorname{tr}(D^{-1} s_6) + \operatorname{tr}(F^\top D^{-1} s_7) - \mu^\top D^{-1} F s_8 - \gamma^\top D^{-1} F s_9 \\ &\quad - \frac{1}{2} \operatorname{tr}(F^\top D^{-1} F s_{10}) - \mu^\top D^{-1} \gamma + L_{GIG}(p, a, b | s_1, s_2, s_3), \end{aligned}

where LGIGL_{GIG} is the GIG log likelihood, using the order (logY,Y1,Y)(\log Y,Y^{-1},Y) throughout. The fixed standard-normal term 12tr(s10)-\tfrac12\operatorname{tr}(s_{10}) and parameter-independent normalizing constants are omitted from LFAL_{FA}.

M-step for the normal block

Assume s10s_{10} is invertible and the two location/skew equations below have a nonsingular coefficient matrix. Eliminating FF from the normal equations gives the following auxiliary quantities:

q1=s8s101s8s2,q2=s9s101s81,q3=s9s101s9s3,q4=s7s101s8s5,q5=s7s101s9s4.\begin{aligned} q_1 &= s_8^\top s_{10}^{-1} s_8 - s_2, \\ q_2 &= s_9^\top s_{10}^{-1} s_8 - 1, \\ q_3 &= s_9^\top s_{10}^{-1} s_9 - s_3, \\ q_4 &= s_7 s_{10}^{-1} s_8 - s_5, \\ q_5 &= s_7 s_{10}^{-1} s_9 - s_4. \end{aligned}

Here s7s_7 is d×rd\times r, so q4,q5q_4,q_5 are dd-vectors. The source transpose on s7s_7 in these two expressions is corrected to make the products dimensionally consistent. The parameter updates are:

μ=q2q5q3q4q22q1q3,γ=q2q4q1q5q22q1q3,F=(s7μs8γs9)s101,D=diag ⁣(s2μμ+s3γγs4γγs4s5μμs5+s6s7FFs7+Fs8μ+μ(Fs8)+Fs9γ+γ(Fs9)+Fs10F+μγ+γμ),(p,a,b)=argmaxp,a,bLGIG(p,a,bs1,s2,s3).\begin{aligned} \mu &= \frac{q_2 \, q_5 - q_3 \, q_4}{q_2^2 - q_1 \, q_3}, \\ \gamma &= \frac{q_2 \, q_4 - q_1 \, q_5}{q_2^2 - q_1 \, q_3}, \\ F &= (s_7 - \mu \, s_8^\top - \gamma \, s_9^\top) \, s_{10}^{-1}, \\ D &= \operatorname{diag}\!\big( s_2 \mu \mu^\top + s_3 \gamma \gamma^\top - s_4 \gamma^\top - \gamma s_4^\top - s_5 \mu^\top - \mu s_5^\top + s_6 \\ &\qquad - s_7 F^\top - F s_7^\top + F s_8 \mu^\top + \mu (F s_8)^\top + F s_9 \gamma^\top + \gamma (F s_9)^\top \\ &\qquad + F s_{10} F^\top + \mu \gamma^\top + \gamma \mu^\top\big), \\ (p, a, b) &= \arg\max_{p, a, b} L_{GIG}(p, a, b | s_1, s_2, s_3). \end{aligned}

Conditional Expectations for the E-Step

Integrating (2) over zz gives the ordinary GH joint law of (X,Y)(X,Y) with dispersion Σ=FF+D\Sigma=FF^\top+D and conditional covariance Cov(XY)=YΣ\operatorname{Cov}(X\mid Y)=Y\Sigma. Therefore the conditional distribution of YY given XX is:

YX=xGIG ⁣(pd2,a+γ(FF+D)1γ,b+(xμ)(FF+D)1(xμ)),Y | X = x \sim \operatorname{GIG}\!\left(p - \frac{d}{2}, \, a + \gamma^\top (F F^\top + D)^{-1} \gamma, \, b + (x - \mu)^\top (F F^\top + D)^{-1} (x - \mu)\right),

and the conditional moments E[YαX,u]E[Y^\alpha | X, u] and E[logYX,u]E[\log Y | X, u] are computed using (4).

The conditional distribution of (X,Z)(X, Z) given YY is Gaussian:

((XμγY)/YZ)Y,uN ⁣(0,(FF+DFFI)).\begin{aligned} \begin{pmatrix} (X - \mu - \gamma Y)/\sqrt{Y} \\ Z \end{pmatrix} \Bigg| Y, u \sim N\!\left(0, \begin{pmatrix} F F^\top + D & F \\ F^\top & I \end{pmatrix}\right). \end{aligned}

Define A=F(FF+D)1A = F^\top (F F^\top + D)^{-1}. The conditional expectations of the latent factor ZZ are:

E[ZY1/2X,u]=A(Xμ)E[Y1X,u]Aγ,E[ZY1/2X,u]=A(Xμ)AγE[YX,u],E[ZZX,u]=IAF+A(Xμ)(Xμ)AE[Y1X,u]A(Xμ)γAAγ(Xμ)A+AγγAE[YX,u].\begin{aligned} E[Z Y^{-1/2} | X, u] &= A(X - \mu) E[Y^{-1} | X, u] - A \gamma, \\ E[Z Y^{1/2} | X, u] &= A(X - \mu) - A \gamma \, E[Y | X, u], \\ E[Z Z^\top | X, u] &= I - A F + A(X - \mu)(X - \mu)^\top A^\top E[Y^{-1} | X, u] \\ &\quad - A(X - \mu)\gamma^\top A^\top - A \gamma (X - \mu)^\top A^\top + A \gamma \gamma^\top A^\top E[Y | X, u]. \end{aligned}

E-Step

Given i.i.d. samples x1,,xnx_1, \ldots, x_n and current parameters uk=(μk,γk,Fk,Dk,pk,ak,bk)u_k = (\mu_k, \gamma_k, F_k, D_k, p_k, a_k, b_k), the E-step computes all ten sufficient statistics. The first six are the same as the standard EM algorithm (see (7)):

s1(k)=1nj=1nE[logYX=xj,uk],s2(k)=1nj=1nE[Y1X=xj,uk],s3(k)=1nj=1nE[YX=xj,uk],s4(k)=1nj=1nxj,s5(k)=1nj=1nxjE[Y1X=xj,uk],s6(k)=1nj=1nxjxjE[Y1X=xj,uk].\begin{aligned} s_1^{(k)} &= \frac{1}{n} \sum_{j=1}^n E[\log Y | X = x_j, u_k], \\ s_2^{(k)} &= \frac{1}{n} \sum_{j=1}^n E[Y^{-1} | X = x_j, u_k], \\ s_3^{(k)} &= \frac{1}{n} \sum_{j=1}^n E[Y | X = x_j, u_k], \\ s_4^{(k)} &= \frac{1}{n} \sum_{j=1}^n x_j, \\ s_5^{(k)} &= \frac{1}{n} \sum_{j=1}^n x_j \, E[Y^{-1} | X = x_j, u_k], \\ s_6^{(k)} &= \frac{1}{n} \sum_{j=1}^n x_j x_j^\top E[Y^{-1} | X = x_j, u_k]. \end{aligned}

The remaining four are determined by the first six using Ak=Fk(FkFk+Dk)1A_k = F_k^\top (F_k F_k^\top + D_k)^{-1}:

s7(k)=(s6(k)s5(k)μks4(k)γk)Ak,s8(k)=Ak(s5(k)μks2(k)γk),s9(k)=Ak(s4(k)μkγks3(k)),s10(k)=IAkFk+Ak(s6(k)s5(k)μkμk(s5(k))+μkμks2(k)(s4(k)μk)γkγk(s4(k)μk)+γkγks3(k))Ak.\begin{aligned} s_7^{(k)} &= (s_6^{(k)} - s_5^{(k)} \mu_k^\top - s_4^{(k)} \gamma_k^\top) A_k^\top, \\ s_8^{(k)} &= A_k (s_5^{(k)} - \mu_k \, s_2^{(k)} - \gamma_k), \\ s_9^{(k)} &= A_k (s_4^{(k)} - \mu_k - \gamma_k \, s_3^{(k)}), \\ s_{10}^{(k)} &= I - A_k F_k + A_k \big(s_6^{(k)} - s_5^{(k)} \mu_k^\top - \mu_k (s_5^{(k)})^\top + \mu_k \mu_k^\top s_2^{(k)} \\ &\quad - (s_4^{(k)} - \mu_k) \gamma_k^\top - \gamma_k (s_4^{(k)} - \mu_k)^\top + \gamma_k \gamma_k^\top s_3^{(k)}\big) A_k^\top. \end{aligned}

The M-step then applies (8) and (7) with s=(s1(k),,s10(k))s = (s_1^{(k)}, \ldots, s_{10}^{(k)}).

Feasibility and interpretation

The first six blocks agree with the Batch 1 order (logY,Y1,Y,X,X/Y,XX/Y)(\log Y,Y^{-1},Y,X,X/Y,XX^\top/Y); the source factor note puts the first three in a different order. The remaining blocks record posterior factor cross moments. Matrix pairings use traces, or equivalently independent symmetric coordinates, as in the exponential-family core.

The displayed normal-block updates solve a weighted regression with diagonal residual dispersion. They require a nonsingular regressor moment matrix and strictly positive updated residual variances. Zero diagonal entries put the optimum on a boundary; blindly inverting that update is invalid. The GIG block remains a constrained numerical maximization, so the full M-step is not generally closed form. Under exact posteriors and an improving M-step, the usual EM ascent argument applies to the observed likelihood.

FF+DFF^\top+D is positive definite when DD is, but factor structure alone does not give a uniform condition-number bound. Orthogonal rotations FFOF\mapsto FO, OO=IrO^\top O=I_r, leave Σ\Sigma unchanged; individual loading columns are therefore not identified without further conventions. The GH mixing-scale ambiguity also remains. Neither ambiguity establishes any new Fisher-curvature or research-gauge formula.

This is a curved family: fitting its normal block is a constrained maximization, not inversion of arbitrary ambient moments. Running sufficient statistics can still be used with a suitable constrained M-step; see online EM for curved families. Penalized shrinkage is a separate way to regularize estimation. The mathematical EM framework explains how aggregation and parameter recovery fit together; package interfaces remain in the upstream design.

Source and adaptation

Adapted from xshi19/normix, docs/theory/factor_analysis.md, at revision 763bb3608920661a012cf089888d349fbf680aad (2026-09-13 import). Copyright (c) 2020 xshi19. Licensed under MIT. The pinned source records the original version. Notation, mathematical qualifications, and links were adapted for this site. Package interfaces, fitter recipes, and executable cells are omitted; no upstream benchmark or formal-proof verification is claimed.

MIT permission notice

MIT License

Copyright (c) 2020 xshi19

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.