Tutorials › Multi-Omics Data Integration › Orthogonality-Constrained NMF

Non-Negative Matrix Factorization · Tutorial 200 of 597

Orthogonality-Constrained NMF

You will distinguish hard orthogonality constraints from soft penalties, interpret their effect on overlapping NMF components, and calculate a penalized fit.

Advanced 11 min read

What You'll Learn

  • Define hard orthogonality constraints on NMF feature or sample factors.
  • Explain why nonnegative orthogonal components cannot share positive support.
  • Construct a soft penalty for overlap and interpret its tuning parameter.
  • Calculate and compare reconstruction-plus-penalty objectives.
  • Identify scale, sparsity, and fit limitations of orthogonality constraints.

Why Control Component Overlap?

A nonnegative matrix factorization represents a nonnegative data matrix \(X\) as an approximate product of two nonnegative matrices. The columns of the feature factor describe component profiles across features; the rows of the score factor describe how components are expressed across samples. Components may overlap: the same feature can have positive weight in several profiles, and a sample can have positive scores for several components. This is often scientifically plausible, but sometimes a model is easier to interpret if components are less overlapping.

Orthogonality is one way to discourage or prohibit that overlap. It is a modeling choice, not a general requirement of NMF. In particular, nonnegative orthogonal components have a stronger interpretation than merely “uncorrelated” signed vectors: their positive supports cannot intersect. Whether that is sensible depends on whether shared features or shared sample activity are plausible in the application.

Definition: Let \(X\in\mathbb{R}_{+}^{m\times n}\), and approximate it by \(WH\), where \(W\in\mathbb{R}_{+}^{m\times r}\) and \(H\in\mathbb{R}_{+}^{r\times n}\). Write \(w_k\) for column \(k\) of \(W\), and \(h_k\) for row \(k\) of \(H\). A hard orthogonality constraint on \(W\) requires \(w_k^T w_l=0\) for every distinct pair \(k,l\); a hard constraint on \(H\) requires \(h_k h_l^T=0\) for every distinct pair. A soft orthogonality penalty adds a nonnegative cost for nonzero pairwise inner products to the reconstruction objective, rather than requiring those products to equal zero.

What Orthogonality Means With Nonnegative Factors

For two nonnegative vectors \(u\) and \(v\) of the same length, their inner product is \(u^Tv=\sum_j u_jv_j\). Every summand is nonnegative. Therefore, \(u^Tv=0\) if and only if \(u_jv_j=0\) at every coordinate \(j\). In words, the vectors cannot both be positive at the same coordinate. A hard constraint on \(W\) thus assigns each feature to at most one component with positive weight. A hard constraint on \(H\) means each sample has a positive score for at most one component.

This is a much more restrictive condition than orthogonality in unconstrained methods, where positive and negative products can cancel. For example, the signed vectors \((1,1)\) and \((1,-1)\) have inner product zero despite sharing both coordinates. Such cancellation is impossible for nonnegative vectors. Orthogonality of \(W\) and orthogonality of \(H\) are also different modeling assumptions: the former excludes shared features, while the latter excludes co-activity in samples.

Worked Example: Interpreting a Hard Constraint

Suppose two hypothetical component profiles across three features are \(w_1=(0.8,0.4,0)\) and \(w_2=(0,0.5,0.7)\). Their inner product is \(w_1^Tw_2=(0.8)(0)+(0.4)(0.5)+(0)(0.7)=0.20\). The profiles are not orthogonal: both assign positive weight to feature 2. If the model imposed hard orthogonality on \(W\), at least one of those two weights on feature 2 would have to be zero. Orthogonality would therefore rule out a shared feature contribution, not merely make the profiles look more distinct.

Hard constraints are sometimes written \(W^TW=I\) or \(HH^T=I\), where \(I\) is the identity matrix. These equations impose both orthogonality and unit norms. The off-diagonal zero conditions alone impose orthogonality; diagonal values need not be one. Because NMF has scale indeterminacy—\(WH=(WD)(D^{-1}H)\) for a positive diagonal matrix \(D\)—a norm convention must be made explicit if unit norms are imposed. The hard support restriction follows from the off-diagonal conditions in either formulation.

Soft Orthogonality in a Penalized Objective

A common soft approach adds a penalty to the squared-error NMF objective. For example, if overlap in sample scores is of interest, one may use

$$ J(W,H)=\frac{1}{2}\lVert X-WH\rVert_F^2+ \frac{\lambda}{2}\sum_{k<l}(h_kh_l^T)^2, \qquad W\geq 0,\quad H\geq 0. $$

Here \(\lVert A\rVert_F^2\) is the sum of the squared entries of \(A\), and \(\lambda\geq0\) controls the trade-off. The first term measures reconstruction error; the second penalizes pairs of score rows that have large inner products. When \(\lambda=0\), there is no orthogonality penalty. Increasing \(\lambda\) makes overlap more costly relative to reconstruction error. A finite penalty generally encourages smaller overlaps but does not guarantee exact orthogonality.

The displayed penalty uses unnormalized inner products, so it reflects both the angle and the magnitudes of the score rows. Its value also depends on scale. To make that penalty interpretable, one must use a consistent scale convention—for example, normalize each active column of \(W\) to unit norm and place its amplitude in the corresponding row of \(H\). A normalized-correlation penalty is another option when the aim is to penalize direction rather than magnitude, but it is undefined for a zero row and requires a rule for inactive components. The penalty’s definition and scaling convention should be reported alongside \(\lambda\); its numerical value is not meaningful in isolation.

Worked Example: Calculating a Soft-Penalty Objective

Consider hypothetical data and fixed factors \(X=\begin{pmatrix}1&1\\1&0\end{pmatrix}\), \(W=I\), and \(H=\begin{pmatrix}1&1\\1&0\end{pmatrix}\). With the objective above and \(\lambda=1\), the reconstruction is exact because \(WH=X\), so the squared-error term is zero. The two score rows have inner product \(h_1h_2^T=(1)(1)+(1)(0)=1\). There is one pair, hence \(J=\frac12(0)+\frac12(1)(1^2)=0.5\). The fit has no reconstruction error but pays a penalty of 0.5 for score overlap.

For comparison, keeping \(W=I\), consider \(H_{\perp}=\begin{pmatrix}1&0\\0&1\end{pmatrix}\). Its score rows have inner product zero, so its penalty is zero. The residual \(X-WH_{\perp}\) is \(\begin{pmatrix}0&1\\1&-1\end{pmatrix}\), whose squared Frobenius norm is \(0^2+1^2+1^2+(-1)^2=3\). Thus \(J(H_{\perp})=\frac12(3)+0=1.5\). At \(\lambda=1\), the exact but overlapping candidate has the lower objective, 0.5 versus 1.5. This comparison evaluates two specified candidates; it does not claim either is the unrestricted global minimizer. It shows how the penalty explicitly trades fit against overlap.

A Small Penalized Optimization

The trade-off can also be solved within a simple restricted family, making the effect of \(\lambda\) explicit. Keep \(X\) and \(W=I\) as above, and restrict the score matrix to \(H(t)=\begin{pmatrix}1&1\\t&0\end{pmatrix}\), where \(t\geq0\). The first row is fixed, while the second component’s score on the first sample is allowed to vary. This is a one-parameter constrained problem, not a claim about all possible NMF factorizations.

Worked Example: Minimizing Within a Restricted Family

The only nonzero reconstruction residual is \(1-t\) in the lower-left entry, so \(\lVert X-WH(t)\rVert_F^2=(1-t)^2\). The score-row inner product is \(t\). Therefore,

$$ J(t)=\frac{1}{2}(1-t)^2+\frac{\lambda}{2}t^2,\qquad t\geq0. $$

Differentiating gives \(J'(t)=-(1-t)+\lambda t=(1+\lambda)t-1\), and \(J''(t)=1+\lambda>0\). The objective is strictly convex, so its unconstrained stationary point is the unique minimum. For \(\lambda\geq0\), it is feasible:

$$ t^*=\frac{1}{1+\lambda}. $$

For \(\lambda=1\), \(t^*=0.5\). The squared residual is \((1-0.5)^2=0.25\), so the reconstruction contribution is \(0.125\); the penalty contribution is \(\frac12(0.5)^2=0.125\). Thus \(J(t^*)=0.250\). At \(\lambda=0\), \(t^*=1\) and the fit is exact. As \(\lambda\) grows, the overlap score decreases toward zero, while the residual increases toward one. This derivation demonstrates the trade-off within the stated family; a general NMF objective remains nonconvex jointly in \(W\) and \(H\).

Choosing the Constrained Factor and Checking the Fit

The factor to constrain should follow the scientific question. Penalizing \(HH^T\)’s off-diagonal entries targets overlap of component scores across samples. Penalizing \(W^TW\)’s off-diagonal entries targets overlap of feature profiles. Applying both penalties is possible, but it can impose a severe restriction: each component would need its own feature support and its own sample support. For multi-omics data, where biological processes may affect several features or coexist in a sample, that restriction may be implausible.

Orthogonality can simplify descriptions by encouraging components to have distinct supports. It does not establish biological independence, causal separation, or statistical uncorrelatedness of measured variables. Components remain products of a chosen factorization model, and the penalty’s effect is relative to the reconstruction term and the data’s scaling. Results should therefore be interpreted as a property of the fitted representation.

Useful diagnostics include the achieved pairwise inner products (or correlations, if that is the penalty used), the reconstruction error, and the factor norms under the chosen scale convention. Examine these across a sensible range of \(\lambda\), rather than judging a fit only by its penalized objective. If overlap barely changes as \(\lambda\) increases, optimization may not have reached a good solution, or the model may be constrained by other choices. If overlap falls but reconstruction error rises sharply, the imposed separation may be distorting the data’s structure. Zero or nearly zero components also need attention: they can make normalized overlaps undefined or appear artificially small.

A soft penalty is not the only alternative. A hard constraint guarantees orthogonality but can make the feasible set restrictive and may prevent a good reconstruction. Ordinary NMF leaves overlap unrestricted and may fit better, while sparse NMF encourages small or zero factor entries through a different penalty; sparsity does not itself ensure orthogonality. These approaches answer different questions and should not be treated as interchangeable.

Common pitfall: “The component profiles are nonnegative and the penalty is large, so their overlap must be zero.” This is incorrect for a finite soft penalty: it balances the penalty against reconstruction error and may retain overlap. Exact zero inner products are guaranteed only by an imposed hard constraint or by a particular optimum that happens to attain zero. Check the fitted pairwise inner products directly.

Practical Limitations

Hard orthogonality may be incompatible with shared biological signals, and a large soft penalty can force components apart even when the data support shared activity. Penalty values are not portable across datasets with different scales, factor normalizations, or objective conventions. Orthogonality constraints also do not remove the general nonconvexity of NMF, so different initializations can yield different local solutions. Compare fits under consistent scaling and initialization practices, report the factor being constrained and the exact penalty, and interpret separation as a modeling preference rather than a discovered law of the system.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions below.

  1. For nonnegative vectors \(u=(1,0,2)\) and \(v=(0,3,0)\), are they orthogonal? What does that imply about their shared support?
  2. What kind of overlap is penalized by a penalty on \(\sum_{k<l}(h_kh_l^T)^2\): shared features or shared sample activity?
  3. For one pair of score rows with inner product 0.4 and \(\lambda=2\), what is the pair’s contribution to the stated soft penalty?
  4. Does a large finite \(\lambda\) guarantee exact orthogonality? Give the reason.

Solutions. (1) Yes: \(u^Tv=(1)(0)+(0)(3)+(2)(0)=0\). Their positive supports do not intersect. (2) It penalizes shared sample activity, because the rows of \(H\) give component scores across samples. (3) The contribution is \(\frac{\lambda}{2}(0.4)^2=\frac{2}{2}(0.16)=0.160\). (4) No. A finite penalty trades overlap against reconstruction error; exact orthogonality is guaranteed by a hard constraint, not by a finite soft penalty.

Clinical Biostats