Updates an existing surprise result with new observations. Useful for real-time or streaming data applications.
Usage
update_surprise(
surprise_result,
new_observed,
new_expected = NULL,
time_value = NULL,
update_prior = TRUE
)Examples
# Initial computation
observed <- c(50, 100, 150)
expected <- c(10000, 50000, 100000)
result <- auto_surprise(observed, expected)
# Update with new data
new_obs <- c(200, 75)
new_exp <- c(80000, 20000)
result <- update_surprise(result, new_obs, new_exp)