AI Decision System
Replayable, offline-verifiable records for AI-assisted go/no-go decisions: experiment promotions, typed model answers and human-approved actions.
翻译准备中
Transparent autoregressive and autoregressive moving-average post-processing for flood forecasts. Provides characteristic-root analysis, Environment Agency parameter assessment, fixed lead-time evalua
翻译准备中
开发工具RGitHub @JonPayneEA在线运营者未确认
试用过了吗? 点一下就好,无需登录。
尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证Transparent autoregressive and autoregressive moving-average post-processing for flood forecasts. Provides characteristic-root analysis, Environment Agency parameter assessment, fixed lead-time evaluation, diagnostics, scoring, and presentation-ready plots.
翻译准备中
取自仓库 README
正在加载完整 README。 以下为已保存的摘录。
reach.postproc provides transparent autoregressive (AR) and autoregressive moving-average (ARMA) post-processing for flood forecasts. It supports parameter construction, characteristic-root analysis, Environment Agency parameter assessment, error projection, fixed lead-time evaluation, scoring and diagnostic plotting.
The package is designed for flood forecast modellers, analysts and developers. It keeps the operational workflow accessible while exposing the mathematics required for review and assurance.查看完整 README ↗reach.postproc provides transparent autoregressive (AR) and autoregressive moving-average (ARMA) post-processing for flood forecasts. It supports parameter construction, characteristic-root analysis, Environment Agency parameter assessment, error projection, fixed lead-time evaluation, scoring and diagnostic plotting.
The package is designed for flood forecast modellers, analysts and developers. It keeps the operational workflow accessible while exposing the mathematics required for review and assurance.
reach.postproc starts from prepared observed and simulated time series. It does not import operational data or apply rating curves.
The intended package boundaries are:
reach.io imports and standardises observations and model data.reach.rate converts between level and flow where required.reach.postproc assesses AR parameters and evaluates forecast updates.Install the development version from GitHub:
# install.packages("pak")
pak::pak("JonPayneEA/reach.postproc")
For local development:
# install.packages("devtools")
devtools::install()
DiagrammeR is optional. Install it if you want Mermaid diagrams rendered as widgets when building the vignettes:
install.packages("DiagrammeR")
The package includes the Environment Agency 2024 default parameters:
library(reach.postproc)
parameters <- default_ar_parameters()
assessment <- assess(
parameters
)
assessment@summary
assessment_table(
assessment
)
Inspect the characteristic roots:
root_information <- roots(
parameters,
time_step_minutes = 15
)
root_table(
root_information
)
plot_ar(
root_information,
root_definition = "modal"
)
The default plot uses modal roots, matching the Environment Agency and Deltares formulation. Stable modal roots lie inside the unit circle.
A reciprocal lag-root view is also available:
plot_ar(
root_information,
root_definition = "lag",
maximum_plot_limit = 5
)
Stable reciprocal lag roots lie outside the unit circle.
Initial errors are supplied newest first:
error_forecast <- forecast_ar(
parameters,
initial_errors = c(
0.15,
0.12,
0.10
),
steps = 96L,
time_step_minutes = 15
)
forecast_series(
error_forecast
)
plot_ar(
error_forecast
)
The package defines model error as:
error = observation - simulation
A positive error means the simulation is too low. A negative error means it is too high.
Prepare observed and simulated series with one row per timestamp:
library(data.table)
observed <- data.table(
date_time = seq(
as.POSIXct(
"2024-11-23 00:00:00",
tz = "UTC"
),
by = "15 min",
length.out = 121L
),
value = observed_values
)
simulated <- data.table(
date_time = observed$date_time,
value = simulated_values
)
Align the series and inspect the diagnostics:
aligned <- align_forecast_series(
observed = observed,
simulated = simulated,
interval_minutes = 15,
timezone = "UTC",
metadata = list(
site_id = "example-site",
event_id = "2024-11",
measure = "level",
units = "m"
)
)
alignment_diagnostics(
aligned
)
aligned_series(
aligned
)
Calculate fixed lead-time updates:
lead_results <- fixed_lead_ar(
parameters = parameters,
data = aligned,
lead_times_minutes = c(
30,
60,
90
),
time_step_minutes = 15,
lower_limit = 0
)
Score and plot the results:
score_lead_times(
lead_results
)
plot_lead_times(
lead_results
)
A parameter pass means the roots avoid the principal forms of unacceptable mathematical behaviour. It does not guarantee that every updated forecast will outperform the simulation.
reach.postproc accepts two coefficient conventions and stores parameters internally in the Deltares convention.
The recurrence is written as:
[ x_t = a_1x_{t-1} + a_2x_{t-2} + \cdots + a_px_{t-p} ]
The 2024 defaults are:
ar_parameters(
coefficients = c(
a_1 = 1.765,
a_2 = -0.72625,
a_3 = -0.040656
),
sign_convention = "Deltares"
)
The same dynamics may be supplied as:
ar_parameters(
coefficients = c(
phi_1 = -1.765,
phi_2 = 0.72625,
phi_3 = 0.040656
),
sign_convention = "Standard"
)
Do not infer the convention from coefficient names alone. Confirm the recurrence or characteristic polynomial used by the source system.
The default assessment applies the criteria established for Environment Agency AR parameter review:
Use explicit arguments if the governing assessment standard differs:
assessment <- assess(
parameters,
maximum_decay_time = 240,
minimum_useful_decay_time = 8,
rapid_decay_exception = 1,
oscillation_ratio = -2 * log(0.1),
decay_measure = "effective",
permitted_orders = c(
2L,
3L
),
time_step_minutes = 15
)
AR post-processing predicts the future development of recent model error. It does not directly model river response.
Keep these limitations in view:
ar_parameters() constructs a parameter set.default_ar_parameters() returns the 2024 defaults.convert_sign_convention() converts supplied coefficient signs.ar_parameters_from_timescales() constructs parameters from root timescales.roots_to_parameters() converts modal roots to AR coefficients.default_family_ar_parameters() constructs a continuous default-family parameter set from one principal decay timescale.standard_family_ar_parameters() returns a published standard point on that family.standard_family_ar_table() lists the full published standard catalogue.fit_ar_from_events() fits AR coefficients by pooled weighted least squares across event windows only.feh_time_to_peak() and feh_lag() estimate FEH catchment response timescales from standard descriptors.roots() calculates modal and reciprocal lag roots.assess() applies the parameter-quality criteria.decompose_ar() separates the projected error into root contributions.response() calculates an ARMA unit response.response_components() compares AR and ARMA responses.align_forecast_series() aligns observed and simulated data.fixed_lead_ar() calculates fixed lead-time updates.score_lead_times() calculates forecast-performance metrics.plot_lead_times() plots observations, simulations and updates.single_origin_ar_update() projects one AR update forward from a single forecast origin.plot_single_origin_update() plots that single-origin update against the observed and simulated series.root_table() returns root diagnostics.assessment_table() returns assessment tests.forecast_series() returns an AR error forecast.aligned_series() returns aligned event data.alignment_diagnostics() returns alignment checks.lead_time_series() returns fixed lead-time results.The package contains ten vignettes:
fit_ar_from_events() and the numerical evidence behind its default weighting scheme.Build and open the vignettes with:
devtools::build_vignettes()
browseVignettes(
"reach.postproc"
)
Run the complete local validation sequence with:
devtools::document()
devtools::load_all()
devtools::test()
devtools::build_vignettes()
devtools::check()
The mathematical test suite should verify at least:
Contributions should include:
This project is released under the MIT licence. See LICENSE for details.