Skip to contents

This 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.frame containing 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 whether data represents Short- or Long-term data. The default, NULL, will assume this from the data by checking whether data[[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 using term and pollutant.

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. table allows a user to select just one. Can be one of "summary", "by_type", "by_site" or "inputs". Note that, if table is provided, the output cannot be then fed into plot_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()

Author

Jack Davison

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.
#> 
#> ── 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.
#> 
#> ── mqor Statistics Set ─────────────────────────────────────────────────────────
#>  MQO Passed
#> Pollutant: PM10
#> Term: short
#> 
#> ── Objects ──
#> 
#> • x$summary (1 row)
#> • x$by_site (15 rows)
#> • x$inputs