Local Whittle Estimator
The Local Whittle Estimator of Robinson (1995b), also called the Gaussian semiparametric estimator, estimates d from the same low frequencies as the Geweke-Porter-Hudak Estimator, but by maximising a local Whittle likelihood of the periodogram instead of a log regression. It needs no assumption of normality and has a smaller variance than the log-periodogram regression for the same frequencies.
The formula for the Local Whittle Estimator starts from the periodogram I of the series at the m lowest Fourier frequencies \(\lambda_{j}\), \(j = 1\), …, m:
\[\lambda_{j} = \frac{2 \cdot \pi \cdot j}{n}\] \[m = \left\lfloor n^{a}\right\rfloor\] \[I(\lambda_{j}) = \frac{\left\lvert \sum_{t=1}^{n} (x_{t} - \bar{x}) \cdot \exp\left(-i \cdot \lambda_{j} \cdot t\right)\right\rvert^{2}}{2 \cdot \pi \cdot n}\]It estimates d as the value that minimises the concentrated local Whittle objective R(d), searched between -0.5 and 1:
\[R(d) = \ln\left(\frac{\sum_{j=1}^{m} \lambda_{j}^{2 \cdot d} \cdot I(\lambda_{j})}{m}\right) - \left(\frac{2 \cdot d}{m}\right) \cdot \sum_{j=1}^{m} \ln\left(\lambda_{j}\right)\] \[\hat{d} = \operatorname*{arg\,min}\left(R(d)\right)\]The statistic divides that estimate by its standard error, which depends only on the number of frequencies:
\[\text{Standard Error} = \frac{1}{2 \cdot \sqrt{m}}\] \[\text{Statistic} = \frac{\hat{d}}{\text{Standard Error}}\]Where \(x_{t}\) is the series, bar(x) its mean, n the number of observations, a the bandwidth power (0.5 by default) and i the imaginary unit. Without long memory the Statistic is standard normal: the short memory null is rejected when the two-sided p-value is below the significance level (0.05 for the 5% level), with hat(d) above 0 pointing to persistence and below 0 to anti-persistence. As for the Geweke-Porter-Hudak Estimator, more frequencies lower the standard error but let short-run autocorrelation bias the estimate.
A series has long memory when its shocks fade so slowly that its autocorrelations decay hyperbolically, like \(k^{2 d - 1}\) at lag k, instead of exponentially as for an ARMA process. Such a series is fractionally integrated with a memory parameter d: differencing it d times, a fraction, leaves short memory. \(d = 0\) is short memory, \(0 < d < 0.5\) long memory that is still stationary (persistent), \(- 0.5 < d < 0\) anti-persistence, d from 0.5 up to 1 a non-stationary but mean-reverting series and \(d = 1\) a unit root. A long memory test asks whether d differs from 0: the null hypothesis is short memory, the alternative long memory or anti-persistence. Returns of liquid assets usually show d close to 0, while their absolute or squared returns (volatility) and many macroeconomic series such as inflation show d clearly above 0. The Hurst exponent of the series is d + 0.5, and the fractional difference removes the memory once d is known.
Also known as: local Whittle, Gaussian semiparametric estimator, Robinson estimator.
In the Finance Toolkit this is get_long_memory_test with method="local_whittle", the same function as Long Memory Test.
Example · AAPL, MSFT · 2016 to 2025
Install the Finance Toolkit with pip install financetoolkit -U, then call get_long_memory_test:
from financetoolkit import Toolkit
toolkit = Toolkit(
["AAPL", "MSFT"],
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2016-01-01",
end_date="2025-12-31",
)
toolkit.econometrics.get_long_memory_test(method="local_whittle")
| Parameter | Type | Description | Example |
|---|---|---|---|
method | str | The test. Options are: “gph” (Geweke-Porter-Hudak Estimator, a log periodogram regression), “local_whittle” (Local Whittle Estimator), “modified_rescaled_range” (Modified Rescaled Range Test, Lo’s modified R/S). Defaults to “gph”. | "gph" |
period | str | The data frequency (daily, weekly, monthly, quarterly, or yearly). Defaults to “daily”. | "weekly" |
column | str | The historical data column. Defaults to “Return”. | "Return" |
power | float | The bandwidth \(m = \text{⌊} n^{\text{power}} \text{⌋}\) of the GPH and local Whittle tests, between 0 and 1: a larger power uses more frequencies, which lowers the standard error but lets short memory bias d. Defaults to 0.5. | 2 |
lags | int | None | The lags q of the modified rescaled range. Defaults to None, which takes Andrews’ (1991) choice. | 2 |
include_benchmark | bool | Whether to include “Benchmark” among the assets. Defaults to False. | True |
rounding | int | None | The number of decimals to round the results to. Defaults to None. | 2 |
show_columns | str | list[str] | None | The columns to keep, a name or a list of names, matched on every column level, or the rows when no column has those names (such as the line items of a financial statement). Names that do not exist are logged, and when none exist the result is returned in full. Defaults to None, which keeps every column. | None, which keeps every column |
Which returns:
| Item | AAPL | MSFT |
|---|---|---|
| d | -0.0864 | -0.0346 |
| Standard Error | 0.0707 | 0.0707 |
| Statistic | -1.2225 | -0.4897 |
| P-Value | 0.2215 | 0.6244 |
| Hurst Exponent | 0.4136 | 0.4654 |
| Frequencies | 50.0000 | 50.0000 |
| Observations | 2,513.0000 | 2,513.0000 |
7 rows
Using Your Own Data
get_long_memory_test runs on any data, not only prices: ratios, economic indicators, yield curves or your own dataset. Pass a DataFrame, a Series or a dictionary of them to Econometrics as data, with the dates in the rows or the columns, and set changes to how its changes are calculated: "percentage", "log", "difference" for rates and ratios, or None when the data are changes already. For example, for the monthly unemployment rates of the United States and Germany:
from financetoolkit import Economics, Econometrics
economics = Economics(start_date="2000-01-01")
unemployment = economics.get_unemployment_rate(
countries=["United States", "Germany"], period="monthly"
)
econometrics = Econometrics(data=unemployment, changes="difference")
econometrics.get_long_memory_test()
References
- Paper Robinson, P.M. (1995b). “Gaussian Semiparametric Estimation of Long Range Dependence.” The Annals of Statistics, 23(5), 1630-1661.