Taiwan effective rank and structure clarity (SSA) — how many components this window needs, not where it goes next
Most indicators that claim to measure “how clean a move is” are really asking the Fourier version of the question: decompose into sinusoids, see where the energy concentrates. The catch is that the sinusoidal basis is our choice, not the data's — a straight trend smears into a blurred low-frequency tail and looks messy, when it is in fact the simplest structure on the site. Singular spectrum analysis (Broomhead & King 1986; Golyandina 2001) drops that assumption: embed the series into a trajectory matrix first, then let the eigenvalues say how many components are needed. Effective rank becomes a number you can read directly. To be explicit up front: all four numbers here are descriptive. They say how many components this window needs and how cleanly signal separates from noise at this window length. None of them says a direction and none of them says what happens next.
The trajectory matrix: why a line becomes a matrix
The first step of SSA is time-delay embedding: pick a window length L, cut a series of length N into N−L+1 overlapping segments of length L, and stack them as rows into a Hankel trajectory matrix (constant along anti-diagonals, because those entries came from the same instant). The move converts adjacency in time into geometry between rows.
We then take the covariance of that matrix with a trace normalisation (tr S = L) applied at construction, and solve for eigenvalues λ₁ ≥ λ₂ ≥ … ≥ λ_L. The normalisation is not cosmetic: multiplying the series by a constant c multiplies the covariance by c², and without normalising, the iterative solver's path would follow the scale. Afterwards the matrix is byte-identical before and after ×c, so scale invariance holds by construction rather than approximately. Eigenvalues come from a deterministic cyclic Jacobi routine using the standard library only, with a fixed sweep bound and no random initialisation: same input, same output.
Singular spectrum entropy is effective rank: ssen and ssd1
Normalise the eigenvalues into p_i = λ_i / Σλ and they form a distribution; −Σ p_i log p_i / log L gives ssen ∈ [0, 1], the singular spectrum entropy, which is effective rank. With all energy in one component ssen → 0 (effective rank near 1); with energy spread evenly across L components ssen → 1 (effective rank near L). It answers how many components this window needs.
ssd1 is λ₁ / Σλ ∈ (0, 1], the leading component's share, answering how dominant the dominant component is. The two are related but not synonymous: a series may need only two components (low effective rank) while those two are evenly matched (modest ssd1). This is also where SSA parts company with linear trend measures — SSA does not assume a trend is a straight line; the shape of the leading component is chosen by the data, so a smoothly curving path can carry a very low effective rank.
The spectral gap ssgp: separability is geometry, not proof of signal
ssgp takes max_i (λ_i − λ_{i+1}) / λ₁ for i ≤ L/2, in [0, 1]: the largest relative spectral gap. In SSA theory, when the first r eigenvalues stand clearly above the rest, those r dimensions form a separable signal subspace and the remainder a noise subspace; the wider the gap, the more cleanly the two separate at this window length. So ssgp measures how clean the structure is, a different dimension from ssd1's how strong the structure is, and the two move independently.
To say it bluntly: a wide gap does not prove that the separated part is a real signal. Separability is a geometric property of this data at this window length, not a causal claim about the world, and pure noise can show a sizeable gap at some particular L. We therefore never read ssgp as a signal-quality score, set thresholds on it, or turn a threshold crossing into an event, and we do not add the four numbers together — a composite score would collapse “strong” and “clean” into one figure nobody can argue with, which is precisely what we deliberately refuse to publish.
The four fields, the window, and what they must not be used for
Query with /v1/indicator/ssen?stock_id=2330; the same family also answers to ssd1, ssgp and ssvr. ssvr is the singular spectrum entropy difference between the volatility channel and the return channel (ssen of |log return| minus ssen of log return) in (−1, 1); a negative value means the volatility envelope is lower-rank than the directional series — still only a comparison of structural complexity between two channels, not a statement about rising or falling prices. Every value carries its window length L and embedding dimension, because changing L changes the spectrum and two numbers computed at different L are not comparable. When there is not enough data to fill a complete window, or the series is degenerate (a constant stretch, say), we return None rather than extrapolate or fill.
No ranking, no screening, no recommendations, no forecasts, no price targets, no entry or exit timing. Sentences like “low effective rank means the trend will continue” or “a wide gap is an entry” will never appear here, because a singular spectrum cannot support them. Effective rank describes the component count of a window that already happened, not a probability over the future. The right use is as a starting question: how long a stretch does this L cover, how does effective rank move when L changes, and why do the volatility and return channels differ in complexity? The answers live in the window you chose and in the raw series, not in the size of the number. It is a data tool, not stock picks, and not a trading signal.