Independent component analysis: separating more than covariance
独立成分分析
Derive whitening and cubic FastICA, recover an original finite mixture, and inspect a converged direction that remains dependent.
icaTwo sensors, two hidden signals
Two sensors record different mixtures of two processes. Rotating a scatterplot until its axes have zero covariance is a useful first step. It does not tell us which axes correspond to the processes: many rotations preserve zero covariance.
Independent component analysis (ICA) asks for a stronger separation. In its basic linear model, each recovered coordinate should carry no statistical information about the others. This is a modeling assumption about the sources, not a consequence of drawing two clean-looking traces. The original ICA formulation and its scale and order ambiguities are described by Hyvärinen and Oja.
Our experiment has eight equally weighted possibilities. The first source is either −1 or 1. Independently, the second is −2, −1, 1 or 2. The sensors report x1 = 7 + 2*s1 + s2 and x2 = -4 + s1 + 3*s2. We give the algorithm only the sensor values. The known sources are kept for checking the result.
This is an exact finite distribution represented by its full Cartesian product, rather than a claim that eight arbitrary measurements are enough for source separation. It lets us distinguish three questions: did whitening work, did the iteration stop, and did the output actually recover the sources?
Whitening removes covariance, not dependence
For the square, noiseless model, let the mixing matrix be invertible and let the sources have finite, nonzero variances. Absorb their means into the offset and their scales into the columns of the mixing matrix. The centered sources can then have unit variance:
Independent sources imply the last equality, but the converse fails. The usual identifiability result further requires at most one Gaussian source. Within a subspace containing several independent unit Gaussian sources, orthogonal rotations produce the same Gaussian distribution, so observations cannot select the original axes. Even in the identifiable case, multiplying a source by a nonzero constant and inversely scaling its mixing column changes nothing; exchanging sources changes nothing either. Choosing unit variance leaves sign and permutation ambiguity. These are properties of the model, not defects to fix with a better stopping tolerance. ICA review, §§2–3
For a nonsingular covariance, choose a Cholesky factor with positive diagonal. Whitening subtracts the fitted mean and solves a triangular system:
The unknown mixing is now an orthogonal rotation or reflection. A PCA-based symmetric whitener is another valid choice; different whiteners change the coordinates in which the remaining rotation is estimated. Neither choice establishes independence. The program estimates covariance with denominator n, and uses that same convention throughout. The identity is exact in real arithmetic; the implementation checks its numerical approximation.
To look beyond covariance, use the fourth cumulant of a centered scalar. For unit variance it equals excess kurtosis. If u1,u2 are independent standardized sources, mixed fourth moments factor, giving:
The cross term in the fourth moment is 6*a²*b²; it cancels against the corresponding variance-squared term. In our example, the cumulants are −2 and −41/25. Because both are negative, the magnitude of the mixture’s cumulant is 2*a⁴+(41/25)*b⁴, at most 2: use a⁴+b⁴ ≤ (a²+b²)² = 1. The source axes are locally attractive candidates for this contrast. This argument is specific to the assumed independent sources and their cumulants. Non-Gaussian distributions can have zero fourth cumulant, so kurtosis is not a universal independence test.
The cubic, one-component FastICA iteration takes a unit direction and updates it using fourth moments. Its fixed-point form avoids a separate learning rate:
The update comes from the stationarity equation for the fourth-cumulant contrast on the unit sphere. The −3*w term uses whitened data and a unit direction. The sign-invariant distance matters: a recovered source and its negative represent the same axis. Normalization is undefined if the update is zero; that is reported separately. Fixed-point algorithm, §3.1
In two dimensions, the perpendicular to a recovered source direction supplies the other axis. The program uses this fact instead of implementing general multi-component deflation. If the first axis is wrong, its perpendicular does not rescue the separation.
A small solver with an honest stopping label
Run the complete program with Python 3 and the standard library. fit_ica copies the observations, whitens them, iterates one direction, and returns the fitted mean, Cholesky factor, two axes and cumulants. transform reuses those fitted quantities for new rows. Its model argument is expected to be an unmodified result of fit_ica.
converged means the direction change is within tol; it does not certify a source or an optimum. iteration-limit means the budget ended before this test passed. A zero budget still fits the whitening transform and returns the initial axis. degenerate-update means an attempted step produced a zero vector; the previous axis is retained. iterations counts attempted updates. A display sign makes the largest-magnitude coordinate of the first axis positive, with the first coordinate winning a tie.
from math import fsum, hypot, isfinite, sqrt
def number(value):
if type(value) not in (int, float):
raise ValueError('use finite int or float coordinates')
try:
value = float(value)
except OverflowError as exc:
raise ValueError('coordinate is outside float range') from exc
if not isfinite(value):
raise ValueError('nonfinite number')
return value
def rows2(rows):
try:
result = tuple(tuple(number(v) for v in row) for row in rows)
except TypeError as exc:
raise ValueError('expected rows of two coordinates') from exc
if any(len(row) != 2 for row in result):
raise ValueError('expected rows of two coordinates')
return result
def finite(value):
if not isfinite(value):
raise ValueError('nonfinite intermediate; rescale the data')
return value
def average(values, n):
try:
return finite(fsum(values) / n)
except (OverflowError, ValueError) as exc:
raise ValueError('unstable arithmetic; rescale the data') from exc
def unit(pair):
length = hypot(*pair)
if length == 0 or not isfinite(length):
raise ValueError('direction must have a finite nonzero norm')
return tuple(v / length for v in pair)
def whiten(data):
data = rows2(data)
n = len(data)
if n < 3:
raise ValueError('at least three rows are required')
mean = tuple(average((row[j] for row in data), n) for j in range(2))
centered = tuple(tuple(finite(row[j] - mean[j]) for j in range(2))
for row in data)
a = average((x*x for x, y in centered), n)
b = average((x*y for x, y in centered), n)
c = average((y*y for x, y in centered), n)
# Absolute safeguards in the input's squared units, not regularization.
if a <= 1e-12:
raise ValueError('first covariance pivot is too small')
l00 = sqrt(a)
l10 = b / l00
pivot = finite(c - l10*l10)
if pivot <= 1e-12:
raise ValueError('second covariance pivot is too small')
l11 = sqrt(pivot)
z = tuple((x/l00, (y - l10*(x/l00))/l11) for x, y in centered)
cov = (average((u*u for u, v in z), n),
average((u*v for u, v in z), n),
average((v*v for u, v in z), n))
if max(abs(cov[0]-1), abs(cov[1]), abs(cov[2]-1)) > 1e-6:
raise ValueError('whitening lost accuracy; rescale or change method')
return mean, (l00, l10, l11), z
def transform(model, data):
# model must be a result of fit_ica; no refitting on the new rows.
rows = rows2(data)
l00, l10, l11 = model['cholesky']
result = []
for x, y in rows:
u = finite((x - model['mean'][0]) / l00)
v = finite((y - model['mean'][1] - l10*u) / l11)
result.append(tuple(finite(a*u + b*v) for a, b in model['axes']))
return tuple(result)
def fit_ica(data, initial=(1, 0), max_iter=100, tol=1e-10):
if type(max_iter) is not int or max_iter < 0:
raise ValueError('max_iter must be a nonnegative integer')
tol = number(tol)
if not 0 < tol < 1:
raise ValueError('tol must be between zero and one')
w = unit(rows2((initial,))[0])
data = rows2(data)
mean, chol, z = whiten(data)
status, iterations = 'iteration-limit', 0
n = len(z)
for iterations in range(1, max_iter + 1):
projection = tuple(w[0]*u + w[1]*v for u, v in z)
raw = tuple(average((row[j]*t*t*t for row, t in zip(z, projection)), n)
- 3*w[j] for j in range(2))
if hypot(*raw) == 0:
status = 'degenerate-update'
break
new = unit(raw)
gap = min(hypot(new[0]-w[0], new[1]-w[1]),
hypot(new[0]+w[0], new[1]+w[1]))
w = new
if gap <= tol:
status = 'converged'
break
# Choose a display sign; it carries no source meaning.
j = 0 if abs(w[0]) >= abs(w[1]) else 1
if w[j] < 0:
w = (-w[0], -w[1])
model = {'mean': mean, 'cholesky': chol,
'axes': (w, (-w[1], w[0])),
'status': status, 'iterations': iterations}
values = transform(model, data)
model['cumulants'] = tuple(
average((row[j]**4 for row in values), n)
- 3*average((row[j]**2 for row in values), n)**2
for j in range(2))
return model
def main():
sources = tuple((a, b) for a in (-1, 1) for b in (-2, -1, 1, 2))
data = tuple((7 + 2*a + b, -4 + a + 3*b) for a, b in sources)
model = fit_ica(data)
values = transform(model, data)
correlations = tuple(tuple(abs(fsum(row[j]*source[k]
for row, source in zip(values, sources))/len(data)
/ sqrt((1, 2.5)[k])) for k in range(2)) for j in range(2))
print('main:', model['status'], model['iterations'])
print('cumulants:', tuple(round(x, 6) for x in model['cumulants']))
print('absolute source correlations:',
tuple(tuple(round(v, 6) for v in row) for row in correlations))
symmetric = tuple((a, b) for a in (-1, 1) for b in (-1, 1))
bad = fit_ica(symmetric, initial=(1, 1))
rotated = transform(bad, symmetric)
cross = fsum(u*u*v*v for u, v in rotated)/4
product = (fsum(u*u for u, v in rotated)/4
* fsum(v*v for u, v in rotated)/4)
print('diagonal:', bad['status'], bad['iterations'],
tuple(round(x, 6) for x in bad['cumulants']))
print('square-product moments:', round(cross, 6), round(product, 6))
print('zero budget:', fit_ica(data, max_iter=0)['status'])
if __name__ == '__main__':
main()
The output is:
main: converged 5
cumulants: (-2.0, -1.64)
absolute source correlations: ((1.0, 0.0), (0.0, 1.0))
diagonal: converged 1 (-1.0, -1.0)
square-product moments: 0.0 1.0
zero budget: iteration-limit
The first fit recovers both standardized sources, up to sign. Correlations with the known sources verify this particular result; they are not available in a genuinely blind application. The second fit starts on a diagonal of a different, symmetric source distribution and stops immediately. It is a counterexample to treating a stopping flag as successful separation.
With two coordinates fixed, n observations and T attempted updates, fitting uses O(n*(T+1)) arithmetic operations and O(n) stored numbers. Transforming m rows uses O(1+m) time and output space. These are floating-point operation counts, not exact-real complexity claims. Input copying, whitening and reported cumulants are included; no growing iteration trace is stored.
A fixed point can still mix the sources
Take independent equiprobable signs s1,s2 and rotate them into u=(s1+s2)/sqrt(2) and v=(-s1+s2)/sqrt(2). The outputs have zero means, unit variances and zero covariance. Yet E[u²*v²]=0 while E[u²]*E[v²]=1: one output being nonzero forces the other to zero. They are dependent. Their cumulants are both −1. The diagonal is an exact sign-flipping fixed point of the cubic iteration, which explains the second result above. Moving to a source axis would give cumulant −2, but a direction-change test does not ask whether a better contrast exists.
Finite samples make the problem harder: estimated fourth moments fluctuate and can be dominated by outliers. Multiple starts and alternative contrasts can be useful, but selecting the best observed kurtosis still does not prove the generative assumptions. The present model excludes measurement noise, nonlinear mixing, more sources than sensors, and changing mixing matrices. A component extracted from a real recording also needs domain evidence before it can be named as a physical cause.
The numerical guards are deliberately visible. Covariance pivots must exceed 1e-12 in squared input units, and the whitened covariance must be within 1e-6 of identity. The code therefore rejects some mathematically valid small-scale or ill-conditioned data. These guards do not add a ridge term or make a singular problem identifiable. Rescaling may help; a larger application needs appropriate numerical linear algebra and a considered dimension choice. Nonfinite inputs and detected nonfinite intermediate results are errors.
Check the assumptions before trusting the axes
- Standardize the second source. Compute its variance, fourth moment and fourth cumulant after standardization.
Work through the moments
Answer: The mean is zero, the variance is (4+1+1+4)/4 = 5/2, and the fourth moment is (16+1+1+16)/4 = 17/2. Divide the fourth moment by (5/2)² and subtract 3: 34/25 - 3 = -41/25. This is why the recovered second component has cumulant −1.64.
- Explain the diagonal failure. Why do zero covariance and immediate convergence not establish independence in the four-point example?
Use a nonlinear moment
Answer: Covariance checks only the product of the two centered outputs. Independence would also require factorization for their squares. Here the square-product expectation is zero and the product of square expectations is one, so independence fails. The cubic update reverses the diagonal direction; the sign-invariant gap is zero even though the axis mixes both sources.
- Change the units of a hidden source. Replace
s1by10*s1. Can the original observations tell which scale is correct?
Track the matching mixing column
Answer: Divide the first mixing column by 10 and every observation is unchanged. Without extra information, the source scale is unidentifiable. The unit-variance convention chooses a representation; it does not recover physical units. Source order and signs are likewise not determined by the observations alone.
- Reuse the fitted transform. A new row arrives after fitting. Should its batch be centered and whitened again? What does a zero iteration budget establish?
Separate preprocessing from convergence
Answer: Apply the training mean, Cholesky factor and axes with transform; independently whitening the new batch would change the coordinate system. A zero budget establishes only that the input passed the implemented whitening checks. The returned initial axis has not undergone a FastICA update, and its status is iteration-limit.
From fourth moments to a family of ICA contrasts
Hyvärinen and Oja’s 1997 fixed-point paper develops a kurtosis-based iteration and mechanisms for extracting several components. Its convergence analysis concerns stated source and initialization conditions; a successful result on one finite distribution does not transfer those guarantees to every dataset. Their 2000 review places fourth-moment methods alongside negentropy, mutual information and likelihood approaches. Different contrasts change sensitivity to source distributions and outliers.
Compare ICA with PCA: PCA chooses directions through second moments and orders them by variance; ICA uses additional distributional assumptions to identify source axes. Independence clarifies what this stronger target means. NMF pursues another decomposition structure, using nonnegative factors rather than independent sources. None of these mathematical criteria alone supplies the semantic name of a component.
Make a prediction, then check
The program reports converged on the diagonal of two independent equiprobable sign sources. What follows?
Learning objectives
- Distinguish whitening from independence and explain scale, sign and permutation ambiguity.
- Derive the cubic fixed-point update under centered, unit-covariance assumptions.
- Check known-source recovery separately from numerical stopping and exhibit a dependent fixed point.
Prerequisites & connections
Explore related knowledge →References
- A Fast Fixed-Point Algorithm for Independent Component Analysis
Aapo Hyvärinen; Erkki Oja · 1997 - Independent Component Analysis: Algorithms and Applications
Aapo Hyvärinen; Erkki Oja · 2000
Version1 · Editorial status: Recorded technical checks completed
View technical check record (AI)
Codex · 2026-09-05 · Codex technical check: primary-source locations, original runnable models, independent mathematical and computational references, bilingual review and second-agent cross-checks; not independent human peer review.
- Eight tests pass. A source-coordinate cumulant ratio closed form independently checks 48 fits (axis up to sign, status and attempted iteration count), using known mixing geometry rather than observation-wise FastICA moments. Known inverse mixing verifies source values up to sign and reconstruction; theoretical cumulants agree.
- Checked whitening moments, reuse on new rows, generator input and preservation, sign/translation/order invariance, a converged dependent diagonal, an exactly zero fourth-cumulant update, zero budget, singular/tiny pivots and malformed/nonfinite inputs. Complete stdout has six lines. Numerical guards deliberately reject some valid ill-conditioned inputs.
- Identical bilingual code and four matching displays, six anchors and four answers pass strict MDX/KaTeX and actual React HTML/MathML checks. Only article_text sets test paths. Original prose follows the pinned Humanizer conventions. Status written records AI author checking, not human review; no production ICA library, noisy-data benchmark or whole-site validation was run.
- Root fully reread both articles, complete program, four formulas and four exercise answers, then reran all eight author tests and strict MDX/KaTeX/actual React HTML. Four corresponding displays, six standard anchors and four answers pass. No modification requested.
- Independent finite-output-level and full-joint-distribution checks validate 12 fits under four nonsingular mixtures and three starting directions. Recovered levels match standardized source magnitudes and all 96 contingency cells satisfy product marginals after grouping numerical levels at tolerance 1e-8. This checks the constructed discrete example, not statistical independence for arbitrary continuous outputs. It uses neither inverse mixing nor the author’s cumulant-ratio trajectory reference.
- Five zero-update angular models have independent level tables only at source-axis orientations; three rotated orientations fail full factorization despite whitened covariance. Separately reviewed the converged diagonal counterexample, attempted-update counts, fitted preprocessing reuse and explicit numerical scale guards. Final five-file SHA values match the frozen author manifest.
- Promoted the full prose, equations, code and exercises. Tests read formal MDX only; removed temporary fallbacks/draft skips and updated review assertion to checked. Algorithm and independent references are unchanged; final record binds both locale hashes.
- Publication navigation points published topics to complete articles and removes corresponding pending wording, retaining directory entries for unwritten targets. Principles, equations, programs and exercises are unchanged; final article SHA values rebound.
- Publication verification found a remaining draft-status substring assertion. It now parses the formal JSON frontmatter and expects checked, independent of serialization whitespace. The numerical tests, their references and article program are unchanged.
Source locations checked:
- A Fast Fixed-Point Algorithm for Independent Component Analysis · Actually downloaded the author-hosted ten-page PDF and viewed pdftoppm images of manuscript pages 2–6: square mixing and ambiguities, fourth cumulant equations (3)–(4), constrained contrast and stationarity equations (5)–(9), §3.1.1 cubic update/normalization/sign-insensitive stop, §3.1.2 multi-component orthogonalization. PDF text encoding was unusable; reading is attributed to the viewed images. The §3.2 proof beyond its opening was not reviewed. Bibliographic year/journal/pages checked against the author’s official FastICA publication list. No universal convergence claim derived from the paper’s informal iteration-count remarks.
- Independent Component Analysis: Algorithms and Applications · Actually read author PDF extracted text: §§2.1–2.2 mixing/ambiguities, §§3.1–3.3 independence versus covariance and Gaussian rotational ambiguity, §4.1 fourth cumulant and outlier sensitivity, §5.2 whitening. Also read located passages on negentropy, mutual information and likelihood for research directions. Official author review.shtml list confirms Neural Networks 13(4–5), 411–430 (2000). The article qualifies nonsingular whitening and nonzero-cumulant requirements instead of repeating informal headings as universal claims.
- A Fast Fixed-Point Algorithm for Independent Component Analysis · Root independently viewed locally rendered original author PDF manuscript pages 4–5: equations 5–9, constrained fourth-cumulant stationarity, §3.1.1 cubic update, normalization and sign-insensitive stopping. The local PDF/images were downloaded/rendered by the author agent; root did not claim a new download or the complete convergence-proof reading. Reviewed the article’s explicit fixed-point counterexample and narrower stopping interpretation.
- Independent Component Analysis: Algorithms and Applications · Root independently opened the author-hosted 31-page review PDF and read extracted text §3.3 lines 229–250: Gaussian rotational ambiguity and the explicit one-Gaussian exception; surrounding nonlinear-moment independence discussion lines 218–228. Reviewed bilingual standardized-source assumptions, invertibility, sign/scale/permutation ambiguities and whitening algebra separately. No full review or benchmark replication claimed.
Related topics