Contact

HPFILTER Function (Gnumeric)

Statistical Intermediate Gnumeric

Separate a numeric time series into Hodrick-Prescott trend and cycle components in Gnumeric, with smoothing-parameter choices and a six-value example.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

HPFILTER applies the Hodrick–Prescott filter to a numeric sequence and returns trend and cyclical components. The result is a smoothed decomposition of the supplied observations, not an extrapolated forecast. Its interpretation depends on the smoothing parameter and on how the series was sampled.

Syntax, input and output

=HPFILTER(Sequence,[lambda])

Sequence must be a one-row or one-column array/reference. lambda is optional and defaults to 1600. The source ignores text, Boolean and blank entries while collecting observations; fewer than six numeric values cause #VALUE!. For a meaningful time-series application, do not let ignored entries silently compress missing time periods: prepare a regularly spaced numeric sequence deliberately.

The result always has two columns and one row for each collected numeric observation. Column 1 is the trend; column 2 is observed minus trend. A rectangular two-dimensional input is rejected. This is different from an operation that preserves arbitrary input matrix shape.

Six-observation example with lambda 1

Put 1,4,2,5,3,6 in A1:A6. Use =HPFILTER(A1:A6,1). Independently expected output, rounded to nine decimals:

Row Trend Cycle
1 1.576923077 -0.576923077
2 2.653846154 1.346153846
3 3.153846154 -1.153846154
4 3.846153846 1.153846154
5 4.346153846 -1.346153846
6 5.423076923 0.576923077

Use =INDEX(HPFILTER(A1:A6,1),1,1) to inspect the first trend value and column index 2 for its cycle. Each row reconstructs the original observation when trend and cycle are added; for row 1,1.576923077−0.576923077 =1 within rounding.

An independent calculation solves (I + lambda×DᵀD)×trend = data, where D takes second differences. For this six-value fixture, solving that ordinary linear system gives the table above; the cycle is then the residual data−trend. This checks the result by a method separate from Gnumeric’s specialized filter solver.

Advanced parameter choices

Larger nonnegative lambda penalizes changes in the trend’s slope more strongly. The default 1600 is a software default, not an automatic recommendation for every sampling frequency or dataset. State the chosen lambda and sampling interval in any analysis, and compare plausible choices rather than implying the filter discovers the “true” trend.

Endpoint estimates can change when later observations are appended, because smoothing uses the supplied sequence as a whole. Treat revisions near the end of a series as a property to investigate, not necessarily a spreadsheet error. A cyclical component is a residual from this decomposition and does not by itself prove an economic or causal cycle.

Errors, history and scope

Five numeric values are insufficient: =HPFILTER(A1:A5,1) is expected to return #VALUE!. A two-dimensional block is also rejected by the source. Numerical solver degeneracy can produce #DIV/0!, but negative/extreme lambda behavior was not tested here; use a defensible nonnegative parameter rather than treating absence of a validation message as endorsement.

NEWS records introduction in Gnumeric 1.11.0. The exact 1.12.57 source contract and small lambda 1 fixture are the scope of this guide; no general accuracy certification for long or ill-conditioned series is implied.

Native fixture results

The native 1.12.57 run matched all twelve trend/cycle values within floating-point rounding and returned #VALUE! for the five-observation input. The displayed table is rounded; the raw comparisons used a 10^-12 tolerance.

Availability and verification scope

The function is present in the inspected official source. Bounded examples are independently calculated; native Gnumeric ssconvert 1.12.57 results are recorded separately below. Retained statistical source 1.12.62 was originally obtained October 13–14, 2026 and inspected October 17; HPFILTER source 1.12.57 was freshly retrieved October 17. No historical-release execution, GUI operation, screenshot, or native 1.12.62 result is implied. The last functioning release is not established. English formulas use commas, with locale-specific separators adjusted as needed.

Array-returning functions require an appropriate result area. The INDEX formulas shown inspect individual elements without promising automatic dynamic-array spilling in the GUI.