Description
Return overlap = max(0,min(contactEnd,riskEnd)-max(contactStart,riskStart)); overlaps is true only when the untruncated difference is strictly positive.
Epidemiological timing depends on which event defines the origin, how intervals include their boundaries and whether time is observed. Numeric day coordinates and elapsed intervals do not by themselves select a calendar or a transmission model.
Return overlap = max(0,min(contactEnd,riskEnd)-max(contactStart,riskStart)); overlaps is true only when the untruncated difference is strictly positive.
When to use this tool
Use Contact Risk Window Overlap Duration Term when reconciling supplied day coordinates, observation windows or interval boundaries.
How to use the tool and how it works
- Enter contactStart, contactEnd, riskStart, riskEnd. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read overlap, overlaps. Inspect overlaps before interpreting the associated values.
Require contactEnd >= contactStart and riskEnd >= riskStart. Return overlap = max(0,min(contactEnd,riskEnd)-max(contactStart,riskStart)); overlaps is true only when the untruncated difference is strictly positive. All coordinates must use a common time unit and origin.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| contactStart | Contact Start | Required. Finite number. |
| contactEnd | Contact End | Required. Finite number. |
| riskStart | Risk Start | Required. Finite number. |
| riskEnd | Risk End | Required. Finite number. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| overlap | Overlap | Required. Finite number. |
| overlaps | Overlaps | Required. Boolean. |
{
"input": {
"contactStart": 10,
"contactEnd": 30,
"riskStart": 20,
"riskEnd": 40
},
"output": {
"overlap": 10,
"overlaps": true
}
} Limitations and assumptions
- Touching endpoints give zero overlap and overlaps = false. Numeric temporal overlap alone does not establish contact intensity, infection, an exposure event or a clinically meaningful risk window.
- 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 an explicit calendar conversion for real dates and a suitable transmission or censoring model for inference beyond these local time calculations.
References
Similar or alternative tools
- Exposure Window Left Truncation Days
Return unobservedDays = max(0, min(windowEnd, observationEntry)-windowStart) and observedDays = max(0, windowEnd-max(windowStart, observationEntry)).
- Person Time Entry Exit Overlap Tool
Calculate supplied person-risk interval overlap with a half-open observation window without determining disease-free eligibility.