to cite this vignette use ...
The package provides functions for flexible assessment of climate model bias and projected changes at multiple time scales. The development of this package was motivated by the fact, that the climate model simulations are often corrected at daily time scales and the bias at longer scales is often ignored. In fact, the widely used bias correction methods work well only at the scale they are calibrated at (often daily) leaving considerable biases at longer time scales. Moreover, driving an impact model with corrected inputs (e.g. precipitation and temperature) does not always provide unbiased response even at the calibrated scale.
To illustrate the workflow let us assume we have observed and climate model simulated data for the control period (1970-1999) and climate model simulated data for the scenario period (2070-2099). Such data are included in the example dataset basin_PT
(see ?basin_PT for details):
library(musica) data(basin_PT) str(basin_PT)
The object basin_PT
is a list of three data.tables (obs_ctrl
- observed data for the control period, sim_ctrl
- simulated data for the control period and sim_scen
- simulated data for the scenario period) each storing date (DTM
), precipitation (PR
) and temperature (TAS
).
Assume further that we also corrected the simulations for both periods. To demonstrate this situation, let us apply standard quantile mapping to the simulated data using function correct
provided within the package:
# for the control period basin_PT[['cor_ctrl']] = correct(obs_ctrl = basin_PT[['obs_ctrl']], sim_ctrl = basin_PT[['sim_ctrl']], sim_scen = basin_PT[['sim_ctrl']]) # for the scenario period basin_PT[['cor_scen']] = correct(obs_ctrl = basin_PT[['obs_ctrl']], sim_ctrl = basin_PT[['sim_ctrl']], sim_scen = basin_PT[['sim_scen']])
The assessment functions provided within the package are not limited to precipitation and temperature. In fact, it is also reasonable to check the bias of the output of an impact model (e.g. runoff simulated by hydrological model). As an example we provide an interface to the GR4J model adapted from the Hydromad pacakge. The runoff can be added to the data.tables by
# observed basin_PT[['obs_ctrl']][, R:=gr4j(data.table(DTM, PR, TAS))] # corrected simulation basin_PT[['cor_ctrl']][, R:=gr4j(data.table(DTM, PR, TAS))] basin_PT[['cor_scen']][, R:=gr4j(data.table(DTM, PR, TAS))] # original simulation basin_PT[['sim_ctrl']][, R:=gr4j(data.table(DTM, PR, TAS))] basin_PT[['sim_scen']][, R:=gr4j(data.table(DTM, PR, TAS))]
Note that the GR4J is run here with default (not calibrated) parameters.
When considering data for different area, corrected by different methods, run with different hydrological model etc. it is not important to follow the structure of basin_PT
dataset - it is also possible to store data.tables (with DTM, PR, TAS and possibly other variables) separately.
The bias/changes are assessed at multiple time scales, therefore the averages over different periods (e.g. 3 days, 10 days, 1 month, 3 months, year, ... etc.) have to be calculated. This is done by function decomp
dobs = decomp(basin_PT[['obs_ctrl']]) str(dobs)
The averaging periods considered by defalut are indicated in the column period
by r dobs[, paste0(unique(period), collapse = ', ') ]
, i.e. overall mean, 1 year, 6 months, 3 months, 1 month, 15 days and 1 day, respectively. The periods are specified in the periods
argument in the form "n units" where "units"" stands for one of "year", "month", "day" (or equivalently "years", "months", "days") and "n" the number of units to average over. For instance to consider annual, 3 months, monthly, 10 days and daily averages use
dobs = decomp(basin_PT[['obs_ctrl']], periods = c('1 year', '3 months', '1 month', '10 days', '1 day')) dobs[, unique(period)]
To let the 3 months periods coincide with climatological seasons (DJF, MAM, JJA, SON) the year_starts
argument can be used
dobs = decomp(basin_PT[['obs_ctrl']], periods = c('1 year', '3 months', '1 month', '10 days', '1 day'), year_starts = -months(1))
This also implies that the annual averages are calculated from December to November.
Finally, as a convenience for further assessment the period within a year (quarter [= season] or month - specified by agg_by
argument) is included in the resulting data.table.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.