Skip to contents

Maps observation age in hours to a confidence multiplier in (0, 1]. Confidence is 1.0 while data is fresh, then decays linearly between breakpoints. Floor of 0.1 — we never claim zero information.

Default schedule (chosen to match the buoy fetch cadence):

  • 0 - 6 h : 1.00 (well within the 6-h fetch cycle)

  • 6 - 24 h : 1.00 -> 0.50 (one missed fetch up to one day)

  • 24 - 72 h : 0.50 -> 0.25 (one to three missed days)

  • > 72 h : 0.10 (floor)

Usage

compute_obs_confidence(age_hours)

Arguments

age_hours

Numeric vector of ages in hours. NA in -> NA out.

Value

Numeric vector in [0.1, 1], same length as age_hours.

See also

Other obs-confidence: obs_status_label(), widen_ci()

Examples

compute_obs_confidence(c(0, 6, 12, 24, 48, 72, 168))
#> [1] 1.0000000 1.0000000 0.8333333 0.5000000 0.3750000 0.2500000 0.1000000