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.