Skip to content

About

R tool to extend a statistics series back across a methodology break with four published methods and report how far they disagree. On Kazakhstan's industry value added, the methods differ by 4.3 pp a year on 1995–2013 growth.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

backcast

test Project Status: Active License: GPL-2

backcast extends an official statistics series back across a change of method and shows how far the published ways of doing it disagree.

When a statistics office changes how it measures something, such as a new base year or a redesigned survey, it publishes the new-method series from some year on and the old-method series up to some year. The series jumps where the method changed, for a reason that has nothing to do with the economy or the population. Users either join the two parts or cut the history off. The usual join, retropolation, carries the level gap in the overlap year (the link) back unchanged. Prados de la Escosura shows that this tends to overstate past levels and understate growth, and proposes interpolation instead (Cliometrica 2016).

The package takes the old and the new series and gives, for every method that applies:

Backcast: the new series extended back over the years only the old series covers, an estimate under the method's assumption, never a published figure.

Spread (spread_pct): the range of the backcasts in each year as a percentage of their mean. It is a range of assumptions, not a confidence interval.

Validation error (error_pct): where both series were published for some years, the error of each backcast against the published values when those years are hidden.

The spread shows how much the choice of method matters, and the validation error which method came closest where the published values are known.

What it does

  • Extends the new series back with four splices: ratio, difference, interpolation (Prados de la Escosura 2016) and mixed splicing (de la Fuente 2013).
  • Predicts the new series back from a related indicator measured the same way throughout, in levels or in yearly changes, and returns the fit.
  • Puts the methods side by side for each year with their spread, and gives the average yearly growth each one implies over a span.
  • Hides the first years of the new series where both were published, backcasts them, and reports each method's error in level and in growth.
  • Tests a series for one break in level or trend with a bootstrap p-value, and dates it.
  • Stops on input it cannot use (missing, zero, negative or duplicate values, names that are not years) and names the first bad year.

Installation

# install.packages("remotes")
remotes::install_github("FerrumSL/series-break-backcast")

It installs strucchange, which the break test uses. The tests run on R 4.6.

Quick start

Kazakhstan's population at the start of each year, from the Bureau of National Statistics. Up to 2021 it is based on the 2009 census, from 2022 on the 2021 census, and the correction was not spread back. The old-method value for 2022 is rebuilt from 2021 plus that year's births, deaths and migration, which gives one year measured both ways.

library(backcast)

old <- setNames(c(15982352, 16203173, 16440254, 16673643, 16909799, 17160220, 17414887,
                  17668720, 17916623, 18155825, 18394642, 18630920, 18878966, 19122408),
                2009:2022)
new <- setNames(c(19503159, 19766807, 20033842, 20283399, 20499822), 2022:2026)

x <- backcast_compare(old, new, base = 2009, rho = 0.5)
round(x[x$period %in% c(2009, 2021), 1:5])
#>    period    ratio difference interpolation    mixed
#> 1    2009 16300581   16363103      15982352 16140682
#> 13   2021 19254870   19259717      19225690 19235169
backcast_growth(x, from = 2009, to = 2021)
#>          method growth_pct
#> 1         ratio   1.397705
#> 2    difference   1.367488
#> 3 interpolation   1.551600
#> 4         mixed   1.472379

For 2022 the new method has 380,751 more people than the old one. The ratio splice assumes the whole gap was already there in 2009. It puts the 2009 population at 16.30 million, 2% above the published figure from that year's census, and keeps the published growth of 1.40% a year. Interpolation assumes the 2009 count was correct, keeps 15.98 million, and spreads the correction over the twelve years, which gives 1.55% a year. Mixed splicing with rho = 0.5 assumes half of the gap was there in 2009 and gives 1.47%. The data cannot say which assumption holds; that depends on how accurate the two censuses were.

Your own data

Each series is a numeric vector named by year, with all values positive.

Argument Required Content
old yes Old-method series
new yes New-method series, sharing at least one year with old
link no Year or years published both ways that tie the two together; the first shared year by default
base for interpolation and mixed splicing Year in which the old series is assumed correct, such as its base year or a census year
rho for mixed splicing Share of the gap at the link already present in base, in (0, 1]
indicator for the indicator splice Related series measured the same way throughout

Years can be given as numbers or strings, in any order. With several link years the ratio splice uses sum(new) / sum(old) over them and the difference splice mean(new - old). Interpolation and mixed splicing take a single link year. splice_indicator(spec = "growth") fits yearly changes (the default fits levels) and needs at least 4 consecutive years shared with the new series. backcast_validate(old, new, hide = 2005:2008, method = splice_ratio) hides the given first years of the new series and takes any function of old and new as the method.

How it works

Function Assumes Keeps from the old series
splice_ratio() the gap is a constant factor growth rates
splice_difference() the gap is a constant amount absolute changes
splice_interpolate() the old series was correct in base and the gap built up gradually since, as its weights went out of date (Prados de la Escosura 2016) growth rates, corrected by a geometric drift
splice_mixed() the old series was already wrong in base by a share rho of the final gap, and the error grew geometrically since (de la Fuente 2013) growth rates, corrected by an accelerating drift
splice_indicator() a related series was measured the same way throughout nothing; predicts from the indicator

find_break() fits log(x) on a quadratic time trend, takes the sup-F statistic for one break (Andrews 1993), gets its p-value from a bootstrap with AR(1) errors under no break, and dates the break by least squares (Bai and Perron 2003, via strucchange). docs/method.md has the formulas, what the automated tests check, and the full validation.

Validation

scripts/kazakhstan.R takes four revisions of Kazakhstan series between archived releases of the World Bank's World Development Indicators (WDI), hides the first years of the new series, backcasts them, and compares with what was published. Mean absolute error, % of the published level (results/kazakhstan.csv):

Case Hidden Ratio Difference Interpolation
Industry value added, Dec 2014 release: reference year 2000 to 2005, growth rates revised 2005-2008 1.29 5.41 n/a
Industry value added, Dec 2025 release: history revised, mostly from 2009 on 2005-2014 0.45 0.46 0.41
GDP, Dec 2014 release: reference year 2000 to 2005, growth rates unchanged (control) 2005-2008 0.00 5.01 n/a
Population, Dec 2024 release: UN estimates revised back to 1995 2009-2015 0.11 0.28 1.69

These releases mostly show how the World Bank rescales a series between releases. When a release only moves the reference year, its back years are the old ones times a constant, which is the ratio splice by construction, so the GDP case is a control. On the 2025 industry revision the three methods are within 0.05 points, a tie. WDI takes its population from the UN World Population Prospects, so the population case is a UN re-estimate, not a change of method at a statistical office. The December 2014 industry release is the one informative national-accounts case. There the ratio splice gives 5.9% a year of growth over 2005-2009 against 6.2% published. The difference splice does not get a fair test, because on the two reference-year changes the releases are in prices of different years and the gap is a factor. Nor does the indicator splice, fitted on three to five years (its errors are in docs/method.md). Four cases from one country cannot rank methods in general.

In 200 simulated 22-year series per setting with no break, find_break() reported one in 5.0% to 5.5% with independent noise and in 8.5% to 11% with strongly autocorrelated noise (AR 0.7), at a nominal 5% (Monte Carlo SE about 2 points). It found a 10% level jump in the middle of the series in 99% to 100% of runs and a 5% jump in 53% to 65%, dated at the true year (results/simulation_find_break.csv).

Limitations

  • Every backcast rests on an assumption about how the gap between the two methods arose. Choose the method from what is known about the change (release notes, census and base years) and report the spread with it.
  • There is no confidence interval for a backcast. The spread is a range of assumptions.
  • base and rho are judgements the data cannot estimate. Try several values.
  • The indicator splice fitted on a few years can be far off. Check attr(, "fit") and compare spec = "growth".
  • The validation covers four revisions in one country and one source. Revisions where an office changed growth rates, in other countries or the Bureau's own releases, would test more.
  • find_break() finds one break only, and its error rates were measured for a break in the middle of a 22-year series. Use it to check a documented break date, not as proof of a cause.
  • Annual series only.

Reproducing the results

Rscript -e 'renv::restore()'          # packages as pinned in renv.lock
Rscript scripts/kazakhstan.R          # WDI validation and industry backcast, about 2 seconds
Rscript scripts/bns_population.R      # population across the 2021 census, about 2 seconds
Rscript scripts/simulation_splice.R   # splice simulation, about 20 seconds
Rscript scripts/simulation.R          # size and power of find_break(), about 10 minutes

The first two scripts download only what is missing from data/raw/, where the files used for results/ are stored. The simulations use fixed seeds. The scripts source("R/backcast.R"), so they run from a clone without installing the package. The tests run with Rscript -e 'testthat::test_local()'.

Related software

  • tempdisagg, gseries and rjd3bench do temporal disaggregation and benchmarking (making sub-annual series consistent with annual totals), and IndexNumberTools chain-links index numbers. A search of CRAN on 2026-10-24 found no package that backcasts a series across a change of method or compares the ways of doing it.
  • The UN handbook on backcasting national accounts describes retropolation, interpolation and mixed splicing; it was a September 2018 draft when checked on 2026-10-24 (UNSD).
  • The Australian Bureau of Statistics added a backcasting facility to its own seasonal adjustment software in 2006 (ABS Methodological News, archived copy).
  • breakpoint-drift deals with the same problem in antimicrobial resistance, where a change of breakpoints looks like a change in the bacteria.

Citation

GitHub's Cite this repository button gives the reference from CITATION.cff.

Licence and credits

GPL-2. Data: World Bank WDI Database Archives (CC BY 4.0); oil production from the Energy Institute Statistical Review of World Energy via Our World in Data (check their terms before reuse); population tables from the Bureau of National Statistics of Kazakhstan (stat.gov.kz). All were downloaded in October 2026. Questions and bug reports: GitHub issues.

About

R tool to extend a statistics series back across a methodology break with four published methods and report how far they disagree. On Kazakhstan's industry value added, the methods differ by 4.3 pp a year on 1995–2013 growth.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages