Skip to content

Main content

Migration Cohort Balance Gap Tool

Calculate migration cohort balance gap from explicit caller-supplied inputs.

Loading tool…

Description

Reconcile migration cohort counts with exact integer arithmetic.

Population records distinguish cohort balances, time exposure, survival expectations and observation coverage. Exact arithmetic can preserve counts while the definitions, exclusions and missingness still need independent verification.

Reconcile migration cohort counts with exact integer arithmetic.

When to use this tool

Use Migration Cohort Balance Gap when checking an explicit cohort record or exposure-support convention.

How to use the tool and how it works

  1. Enter start, arrivals, departures, observedEnd. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read expectedEndDecimal, residualDecimal. Use the output convention below.

Reconcile migration cohort counts with exact integer arithmetic. Require nonnegative whole counts and departures <= start+arrivals; return expectedEndDecimal = start+arrivals-departures and observed-minus-expected residualDecimal.1

Input fieldMeaning and unitsAccepted input
startNonnegative safe-integer numeric starting count; output totals use exact BigInt arithmetic.Required. Safe integer; minimum 0.
arrivalsNonnegative safe-integer numeric arrivals count.Required. Safe integer; minimum 0.
departuresNonnegative safe-integer numeric departures count, no greater than start+arrivals.Required. Safe integer; minimum 0.
observedEndNonnegative safe-integer numeric observed ending count.Required. Safe integer; minimum 0.
Output fieldInterpretationReturned shape
expectedEndDecimalExact start+arrivals-departures as a decimal integer string.Required. Text; maximum UTF-16 length 8192.
residualDecimalExact observedEnd-expectedEnd as a decimal integer string.Required. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "start": 100,
    "arrivals": 20,
    "departures": 10,
    "observedEnd": 108
  },
  "output": {
    "expectedEndDecimal": "110",
    "residualDecimal": "-2"
  }
}

Limitations and assumptions

  • Exact decimal strings preserve large totals; no migration events or cohort identity are verified.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Use suitable population and event data, including censoring and coverage evidence, for demographic inference beyond local bookkeeping.

References

  1. Calculation and input contract: demographic-economics/migration-cohort-balance-gap — tool.io

Similar or alternative tools