﻿# TimesFM 2.5 missing data: interpolation, context trimming and padding are model inputs

Audit the TimesFM 2.5 forecasting path that strips leading missing values, interpolates remaining gaps and trims or pads history before model execution.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-timesfm25-nan-interpolation-context-padding-contract/
Language: en

## Reconstruct the effective history

The values sent by an application are not always the values consumed by its forecasting network. TimesFM 2.5 includes numerical preparation in its forecasting wrapper. The [generation-specific API reference](https://raw.githubusercontent.com/google-research/timesfm/master/timesfm-forecasting/references/api_reference.md) describes missing-value treatment and context handling. Reproducibility therefore requires the preparation policy and configuration, not merely a raw history and weight identifier. This guide concerns that older implementation rather than assuming the newer generation behaves identically.

## Distinguish missing measurements from inferred values

The [base forecasting implementation](https://raw.githubusercontent.com/google-research/timesfm/master/src/timesfm/timesfm_2p5/timesfm_2p5_base.py) strips leading NaNs and applies interpolation to remaining missing positions before constructing the model batch. Those filled positions are inferred numerical values, not newly observed measurements. Preserve the original observation mask in the evaluation preparation record. Otherwise, a model comparison can accidentally reward a preprocessing choice while attributing all changed error to the neural network.

## Explain which history survives the context limit

Histories exceeding the configured context are trimmed to their recent tail; shorter histories receive left padding and a padding mask. The [forecast configuration](https://raw.githubusercontent.com/google-research/timesfm/master/src/timesfm/configs.py) controls this boundary. A long source series does not prove that an early seasonal event reached the network. Compare the retained window before concluding that a checkpoint ignored useful historical information. Changing max_context changes both effective evidence and resource use.

## Do not confuse input repair with forecast-origin leakage

Interpolation within the supplied historical window uses that window's available observations. A replay still needs an as-of input cut: values that arrived after the forecast origin must not enter the historical array merely because their timestamps are old. The [entity split guide](/journal/data-guide-entity-group-split-design/) provides related population controls. Test source availability independently of the network's ability to fill a numerical gap, since these are different questions about the evidence.

## Validate boundary cases explicitly

Use leading gaps, an internal gap, a short history, a trimmed history and an entirely unusable history as reviewed fixtures. Define an application policy for insufficient evidence rather than assuming every library fallback is appropriate. The [original Chronos missing-value guide](/journal/fg2-original-chronos-numeric-bins-scale-missing-values/) illustrates a contrasting representation boundary. Accept the adapter when it makes effective history, inferred values and padding explicit, then evaluate forecast quality on that documented input population.
