Quickly summarise observed (measured) and modelled concentrations for MQO evaluation
summarise_mqo_stats.RdThis function calculates all of the model quality objective indictors (e.g.,
vec_mqi()) and all of the complementary indicators (e.g.,
vec_pi_bias()) for a given dataset. Further relevant summaries are also
calculated; for example, the 90th percentile of mqi values, mqi_90, is
calculated using mqo_percentile(). Two or three datasets are returned; an
overall summary dataset, a by_site site-wise summary, and - for long-term
data - a by_type split fixed/indicative summary.
Usage
summarise_mqo_stats(
data,
pollutant,
term = NULL,
params_fixed = NULL,
params_indicative = NULL,
dict = mqor::mqo_dict(),
table = NULL
)Arguments
- data
An R
data.framecontaining at least five columns; a numeric column of observed values, a numeric column of modelled values, a character or factor column of identifiers that identify the site associated with the concentrations, a character or factor column of identifiers that identify the pollutant being measured/modelled, and a character or factor column containing just"fixed"or"indicative"to label each site. See demo_shortterm for an example format.- pollutant
The pollutant to calculate model quality objectives for. Should be a value contained within
data[[dict$pollutant]].- term
Either
"short"or"long", identifying whetherdatarepresents Short- or Long-term data. The default,NULL, will assume this from thedataby checking whetherdata[[dict$site]]contains duplicate values.- params_fixed, params_indicative
See
mqo_params()for more information. Defines fixed and indicative parameters. By default,{mqor}attempts to sample appropriate values from default_params usingtermandpollutant.- dict
See
mqo_dict()for more information. Acts as a data dictionary to specify the columns in the data{mqor}should use.- table
By default this function returns a list of different data objects.
tableallows a user to select just one. Can be one of"summary","by_type","by_site"or"inputs". Note that, iftableis provided, the output cannot be then fed intoplot_mqi_scatter()and similar functions.
Value
a list with at most the objects summary showing whole data
summaries (e.g., mqi_90), by_type which shows per-fixed/indicative
values, by_site which shows per-site values (e.g., mqi), and inputs
which give the input parameters. The columns in each vary depending on the
value of term. Just one of these can be selected using the table
argument.
See also
Other model performance indicators:
vec_bias(),
vec_pi_bias()
Examples
summarise_mqo_stats(
demo_longterm,
pollutant = "PM10"
)
#> ! term assumed to be 'long'.
#> ℹ If this is incorrect, please specify the data's term using the term argument.
#>
#> ! Using fixed long-term annual pm10 parameters.
#> ℹ If this is incorrect, please use `mqor::mqo_params()` or
#> `mqor::mqo_params_default()` to construct a parameter set.
#>
#>
#> ── mqor Statistics Set ─────────────────────────────────────────────────────────
#> ✔ MQO Passed
#> Pollutant: PM10
#> Term: long
#>
#> ── Objects ──
#>
#> • x$summary (1 row)
#> • x$by_type (1 row)
#> • x$by_site (15 rows)
#> • x$inputs
summarise_mqo_stats(
demo_shortterm,
pollutant = "PM10"
)
#> ! term assumed to be 'short'.
#> ℹ If this is incorrect, please specify the data's term using the term argument.
#>
#> ! Using fixed short-term daily pm10 parameters.
#> ℹ If this is incorrect, please use `mqor::mqo_params()` or
#> `mqor::mqo_params_default()` to construct a parameter set.
#>
#>
#> ── mqor Statistics Set ─────────────────────────────────────────────────────────
#> ✔ MQO Passed
#> Pollutant: PM10
#> Term: short
#>
#> ── Objects ──
#>
#> • x$summary (1 row)
#> • x$by_site (15 rows)
#> • x$inputs