Wrapper function for sinus optimisation
run_optimisation( data_sw_selected, data_gw_selected, retardation_factor = 2, sw_monitoring_id = ifelse(!is.null(attr(data_sw_selected, "monitoring_id")), attr(data_sw_selected, "monitoring_id"), "surface-water monitoring point"), gw_monitoring_id = ifelse(!is.null(attr(data_gw_selected, "monitoring_id")), attr(data_gw_selected, "monitoring_id"), "groundwater monitoring point"), limits = c(100, 500), tolerance = 0.001, debug = FALSE )
data_sw_selected | data.frame with daily data temperature data of surface water monitoring point with columns "date" (format: "YYYY-MM-DD") and "value" (format: double, temperature in degree Celsius) for selected time period |
---|---|
data_gw_selected | data.frame with daily data temperature data of groundwater monitoring point with columns "date" (format: "YYYY-MM-DD") and "value" (format: double, temperature in degree Celsius) for selected time period |
retardation_factor | hydraulic retardation factor (default: 2) |
sw_monitoring_id | optional label for surface water monitoring id (default: "surface-water monitoring point"
or attr(data_sw_selected, "monitoring_id") if data imported with |
gw_monitoring_id | optional label for groundwater monitoring id (default: "surface-water monitoring point"
or attr(data_sw_selected, "monitoring_id") if data imported with |
limits | minimum/maximum period length for sinus optimisation in days (default: c(100, 500)) |
tolerance | the desired accuracy (default: 0.001 |
debug | show debug messages (default: FALSE) |
list with sim/observation data ("data") fit parameters ("paras"), goodness-of-fit values ("gof")
traveltimes ("traveltimes") and special (min, max, turning) points ("points") as returned by get_predictions
load_temp <- function(base_name) { kwb.heatsine::load_temperature_from_csv( kwb.heatsine::extdata_file(base_name) ) } data_sw <- load_temp("temperature_surface-water_TEGsee-mikrosieb.csv") data_gw <- load_temp("temperature_groundwater_TEG343.csv") data_sw_selected <- kwb.heatsine::select_timeperiod( data_sw, date_start = "2015-10-10", date_end = "2016-10-14" ) data_gw_selected <- kwb.heatsine::select_timeperiod( data_gw, date_start = "2015-12-28", date_end = "2016-12-26" ) kwb.heatsine::run_optimisation(data_sw_selected = data_sw_selected, data_gw_selected = data_gw_selected, retardation_factor = 1.8, sw_monitoring_id = attr(data_sw_selected, "monitoring_id"), gw_monitoring_id = attr(data_gw_selected, "monitoring_id"), limits = c(100, 500), tolerance = 0.001, debug = FALSE)#> $data #> # A tibble: 745 x 9 #> type monitoring_id label date observed simulated residuals #> <chr> <chr> <chr> <date> <dbl> <dbl> <dbl> #> 1 surf… TEGsee-mikro… surf… 2015-10-10 13.5 14.8 -1.25 #> 2 surf… TEGsee-mikro… surf… 2015-10-11 12.9 14.6 -1.70 #> 3 surf… TEGsee-mikro… surf… 2015-10-12 12.2 14.4 -2.23 #> 4 surf… TEGsee-mikro… surf… 2015-10-13 11.7 14.2 -2.55 #> 5 surf… TEGsee-mikro… surf… 2015-10-14 11.2 14.1 -2.82 #> 6 surf… TEGsee-mikro… surf… 2015-10-15 11.1 13.9 -2.74 #> 7 surf… TEGsee-mikro… surf… 2015-10-16 11.1 13.7 -2.60 #> 8 surf… TEGsee-mikro… surf… 2015-10-17 11.2 13.5 -2.35 #> 9 surf… TEGsee-mikro… surf… 2015-10-18 11.0 13.4 -2.32 #> 10 surf… TEGsee-mikro… surf… 2015-10-19 11.0 13.2 -2.16 #> # … with 735 more rows, and 2 more variables: simulated_pi_lower <dbl>, #> # simulated_pi_upper <dbl> #> #> $paras #> # A tibble: 2 x 7 #> type period_length alpha beta y0 a x0 #> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 surface-water 374. -10.3 2.03 12.7 10.5 2.95 #> 2 groundwater 373. -3.74 0.957 10.7 3.86 2.89 #> #> $gof #> # A tibble: 2 x 21 #> type ME MAE MSE RMSE `NRMSE %` `PBIAS %` RSR rSD NSE mNSE #> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 surf… 0 1.24 2.33 1.53 20.1 0 0.2 0.98 0.96 0.82 #> 2 grou… 0 0.24 0.12 0.35 12.5 0 0.13 0.99 0.98 0.9 #> # … with 10 more variables: rNSE <dbl>, d <dbl>, md <dbl>, rd <dbl>, cp <dbl>, #> # r <dbl>, R2 <dbl>, bR2 <dbl>, KGE <dbl>, VE <dbl> #> #> $traveltimes #> # A tibble: 5 x 6 #> point_type `surface-water … `groundwater (T… traveltime_ther… retardation_fac… #> <chr> <date> <date> <dbl> <dbl> #> 1 turning-p… 2015-10-21 2016-01-11 82.1 1.8 #> 2 min 2016-01-23 2016-04-14 82 1.8 #> 3 turning-p… 2016-04-25 2016-07-16 81.9 1.8 #> 4 max 2016-07-28 2016-10-18 82 1.8 #> 5 turning-p… 2016-10-29 2017-01-19 81.9 1.8 #> # … with 1 more variable: traveltime_hydraulic_days <dbl> #> #> $points #> # A tibble: 10 x 6 #> label day_number date observed simulated point_type #> <chr> <dbl> <date> <dbl> <dbl> <chr> #> 1 surface-water (TEGsee… 11 2015-10-21 10.9 12.8 turning-poin… #> 2 surface-water (TEGsee… 105 2016-01-23 1.53 2.25 min #> 3 surface-water (TEGsee… 198 2016-04-25 11.1 12.7 turning-poin… #> 4 surface-water (TEGsee… 292 2016-07-28 24.1 23.2 max #> 5 surface-water (TEGsee… 385 2016-10-29 NA 12.7 turning-poin… #> 6 groundwater (TEG343) 14 2016-01-11 10.4 10.8 turning-poin… #> 7 groundwater (TEG343) 108 2016-04-14 7 6.87 min #> 8 groundwater (TEG343) 201 2016-07-16 10.5 10.7 turning-poin… #> 9 groundwater (TEG343) 295 2016-10-18 14.9 14.6 max #> 10 groundwater (TEG343) 388 2017-01-19 NA 10.7 turning-poin… #>