Understanding in-sample and out-of-sample

Understanding in-sample and out-of-sample

Each Walkforward segment contains two separate periods:

  • in-sample
  • out-of-sample

They serve different purposes.

In-sample

The in-sample period is the historical data used to evaluate candidate parameter combinations.

Best Score or Stable then selects one configuration from those in-sample Results.

The in-sample period answers:

Which configuration is selected for this segment?

Out-of-sample

The out-of-sample period comes after the in-sample period.

The configuration selected in-sample is applied to this later data.

The out-of-sample period answers:

How did the selected configuration behave on the later period?

Why the periods are separated

The data used to select a configuration is kept separate from the later data used to evaluate it.

This separation is repeated for every eligible Walkforward segment.

What forms the final Walkforward performance

In-sample Results are used to select the configuration for each segment.

They are not added to the final Walkforward performance.

The final performance is calculated from the combined out-of-sample trades.

Period units

Walkforward period units follow the dataset timeframe.

Intraday and daily datasets use Trading Days.

Weekly and monthly datasets use the corresponding weekly or monthly periods.

Selection happens again in every segment

Each segment performs a new in-sample evaluation.

The selected configuration can therefore remain the same or change from one segment to another.

Where to go next

Continue with Anchored and Rolling Walkforward to see how the in-sample period moves between segments.

Was this article helpful?