Zipf and Heaps Law Fit
Zipf and Heaps law fitting estimates the power-law exponent of the word rank–frequency distribution and the rate at which vocabulary size grows with the number of tokens in a corpus.
Zipf·Heaps 법칙 적합은 낱말 순위–빈도 분포의 멱법칙 지수와, 낱말 수가 늘 때 어휘 크기가 늘어나는 속도를 말뭉치에서 추정하는 분석입니다.
Does my corpus follow Zipf's law, and how fast does its vocabulary grow as more text is added?
우리 말뭉치가 Zipf 법칙을 따르는지, 글을 더 모으면 어휘가 얼마나 빨리 늘어나는지 알고 싶어요.
Zipf's law states that a word's frequency is proportional to its rank raised to a negative exponent, estimated here by maximum likelihood for a discrete power law over all ranks with a Wald confidence interval. Heaps' law states that vocabulary size grows as K times the number of tokens raised to β, estimated by a log–log regression on the cumulative vocabulary curve.
When to use Zipf and Heaps Law Fit
- You describe the statistical structure of a corpus or compare corpora, languages or genres.
- You need to anticipate how many new word types more data will add.
- You check whether tokenisation produced a plausible frequency distribution.
When to use something else
- You want to test whether the data truly follow a power law against alternatives such as the lognormal; use a goodness-of-fit and likelihood-ratio comparison instead.
- You want vocabulary richness of individual texts; use lexical diversity measures instead.
Assumptions and requirements
- Ranks are taken from the same corpus as the frequencies, which introduces some bias at low frequencies.
- The Heaps curve depends on the order in which documents are concatenated.
- Log–log regression intervals ignore dependence between points and are too narrow.
What the analysis reports
- Zipf exponent (maximum likelihood and log–log OLS) with standard error and 95% CI
- KS distance between empirical and fitted rank distributions
- Heaps K and β with 95% CI and R²
- Top-ranked words with observed and fitted frequencies
- Rank–frequency and vocabulary-growth plots
How to report it
The Zipf exponent was s = [value], 95% CI [[value], [value]], and vocabulary growth followed Heaps' law with K = [value] and β = [value].
Related methods
How this method is validated
이 방법의 검증 근거
- Independent computation. 1 reference test compares the results with reference values computed independently in the test suite.
독립 계산. 시험에서 따로 계산한 참조값 대조 참조 시험 1건 통과.
Tolerances are relative differences (absolute differences for values near zero). R comparisons and reference tests are re-run before each release of the analysis engine.
허용오차는 상대 차이입니다(0 근처 값은 절대 차이). R 대조와 참조 시험은 분석 엔진을 배포할 때마다 다시 돌립니다.
Run Zipf and Heaps Law Fit on Quorant
- Data you need
- a table (CSV or Excel) with an outcome variable
- Price
- 250 credits for one analysis up to 10,000 rows (complexity level 2); larger or wider data costs more. Optional methodologist review: 1200 credits.
- Checking
- Compared with independent computations
- Before you pay
- A free pre-analysis diagnosis checks your data and gives an exact quote; nothing is deducted until you approve it.