Lesson 2 of 3 · Index and date constraints
Bound the time shift
20 minute lesson · 3 checks along the way
Your goal for this lessonApply an admissible alignment band and separate improved optimization scores from independent evidence.
In this lesson 3 sections · 3 checks
Read & understand
A cheap path can demand an implausible shift
Reuse X=[1,1,3] and Y=[1,3,3] with the same local costs and endpoint rule. A path can explain a timing difference only by accepting some displacement between paired observations. If the application permits no displacement, allow only cells with i=j. Our zero-cost path is then inadmissible, because it visits(2,1) and(3,2). A forbidden cell is excluded from the calculation; it is not merely an expensive cell that the algorithm may choose anyway.
Define an index band |i−j|≤w. With w=0, only the diagonal remains, so the minimum cost is2. With w=1, the four-cell zero-cost path fits and the minimum becomes0. Widening an allowed set cannot increase the minimum of the same objective: every previously allowed path remains available. This is a property of optimization, not evidence that the wider rule describes crops more accurately.
Check 1 of 3
10 pointsUse the reading above. You can try again without losing points.
Read & understand
Translate indices into dates only when justified
If both sequences start on the same date and sample every ten days without missing observations, a one-position difference corresponds to ten days. Under those assumptions, w=1 bounds paired-date differences by ten days. Remove the common origin or regular spacing and that interpretation fails. For irregular observations, a date-based rule must inspect the actual dates of each proposed pair, rather than treating a one-column move as a fixed number of days.
For example, X dates[0,10,20] and Y dates[0,10,50] are days relative to a shared origin. Pair(3,3) has zero index displacement but a thirty-day date difference. A ten-day date gate excludes it. Because our model requires that final pair, no complete alignment is feasible. Report that result as unavailable under the chosen rules. Do not silently widen the gate or discard the last observation merely to return a number; either action changes the declared task.
An index is not a date
Original irregular-date example. A same-index pair may fail a physical-time constraint. Closed endpoints plus the stated hard gate make this example infeasible.
Open full-size diagram in a new tab: An index is not a dateRead diagram data as a table
| Index | X day | Y day | Absolute date gap |
|---|---|---|---|
| 1 | 0 | 0 | 0 days |
| 2 | 10 | 10 | 0 days |
| 3 | 20 | 50 | 30 days |
Original irregular-date example. A same-index pair may fail a physical-time constraint. Closed endpoints plus the stated hard gate make this example infeasible.
Check 2 of 3
10 pointsUse the reading above. You can try again without losing points.
Read & understand
Choose and disclose constraints before judging a result
An analyst who keeps widening a band until a preferred template wins is using the desired answer to choose the comparison rule. The lower score then cannot serve as independent confirmation. A defensible comparison specifies cost, endpoints, admissible shifts and missing-data treatment before evaluating held-out observations. Here, held-out means observations not used to choose the templates or those settings. Independent field information can test whether a useful temporal resemblance corresponds to the intended crop category.
Keep the path as well as the final score. It shows which dates were paired repeatedly, where the maximum shift occurred and which assumptions carried the result. A path touching the allowed edge may motivate a sensitivity check; it does not automatically invalidate the match. Likewise, a path well inside the band may still match the wrong class. Optimization answers the specified mathematical question, while validation asks whether that question supports the intended application.
Check 3 of 3
10 pointsUse the reading above. You can try again without losing points.
Put it together
Your lesson progress
Each check connects to a part of the story. Complete all 3 to earn your 25-point lesson bonus.
Explore further · Optional
Go to the source
Explore the evidence behind this lesson. These optional readings and videos open in a new tab.