Title: | traffic light - Tools for data validation |
---|---|
Description: | The package contains tools for data validation and aggregation of validation results. |
Authors: | Jan Philipp Dietrich [aut, cre], Markus Bonsch Bonsch [aut] |
Maintainer: | Jan Philipp Dietrich <[email protected]> |
License: | LGPL-3 |
Version: | 1.15.1 |
Built: | 2024-11-11 03:59:04 UTC |
Source: | https://github.com/pik-piam/trafficlight |
The package contains tools for data validation and aggregation of validation results.
Package: | trafficlight |
Type: | Package |
Version: | 1.000 |
Date: | 2016-10-07 |
License: | LGPL-3 |
Markus Bonsch, Jan Philipp Dietrich
Maintainer: Jan Philipp Dietrich <[email protected]>
A collection of tests to compare the level of data with comparison data
testLevel(x, xc)
testLevel(x, xc)
x |
a data vector of a single data set named and sorted by years |
xc |
a data vector of a single data set named and sorted by years |
Details about the employed tests can be found here: http://redmine.pik-potsdam.de/projects/x-intern/wiki/Traffic_light_validation
A named vector containing results of multiple tests for the single combination of data and comparison data.
Markus Bonsch, Jan Philipp Dietrich
#create some test data test <- 1:40; names(test) <- 1995:2034 x <- test[20:40] xc <- test[1:30] + rnorm(30) testLevel(x,xc)
#create some test data test <- 1:40; names(test) <- 1995:2034 x <- test[20:40] xc <- test[1:30] + rnorm(30) testLevel(x,xc)
A collection of tests to compare the overlap of data with comparison data
testOverlap(x, xc)
testOverlap(x, xc)
x |
a data vector of a single data set named and sorted by years |
xc |
a data vector of a single data set named and sorted by years |
Details about the employed tests can be found here: http://redmine.pik-potsdam.de/projects/x-intern/wiki/Traffic_light_validation
A named vector containing results of multiple tests for the single combination of data and comparison data.
Markus Bonsch, Jan Philipp Dietrich
#create some test data test <- 1:40; names(test) <- 1995:2034 x <- test[20:40] xc <- test[1:30] + rnorm(30) testOverlap(x,xc)
#create some test data test <- 1:40; names(test) <- 1995:2034 x <- test[20:40] xc <- test[1:30] + rnorm(30) testOverlap(x,xc)
A collection of tests to compare the trend of data with comparison data
testTrend(x, xc, t = 40)
testTrend(x, xc, t = 40)
x |
a data vector of a single data set named and sorted by years |
xc |
a data vector of a single data set named and sorted by years |
t |
window size in years for which the trend should be tested. It is tried to create a window -t/2 to t/2 around the start year for trend testing. If this does not work the window can be moved in the range of -t to t around the start year to find comparison data. Comparison data is shifted from the given window to start year to start year + t for analysis |
Details about the employed tests can be found here: http://redmine.pik-potsdam.de/projects/x-intern/wiki/Traffic_light_validation
A named vector containing results of multiple tests for the single combination of data and comparison data.
Markus Bonsch, Jan Philipp Dietrich
#create some test data test <- 1:80; names(test) <- 1995:2074 x <- test xc <- test + rnorm(30) names(xc) <- 1925:2004 testOverlap(x,xc)
#create some test data test <- 1:80; names(test) <- 1995:2074 x <- test xc <- test + rnorm(30) names(xc) <- 1925:2004 testOverlap(x,xc)
Function to evaluate statistical tests concerning model-data compatibility with respect to predefined thresholds to determine agreement classes.
TLevaluate(TLstatistics)
TLevaluate(TLstatistics)
TLstatistics |
MAgPIE object containing statistical test results as
returned by |
Details about the thresholds and the aggregation can be found here: https://redmine.pik-potsdam.de/projects/magpie-intern/wiki/Traffic_light_validation
matrix containing agreement classes (0 = red, 1 = yellow, 2 = green).
Markus Bonsch
TLstatistics
,trafficlight
,TLplot
library(magclass) data("population_magpie") x <- population_magpie xc <- x + runif(length(x)[1],0,10^5) tl <- TLstatistics(x[,,1],xc) TLevaluate(tl)
library(magclass) data("population_magpie") x <- population_magpie xc <- x + runif(length(x)[1],0,10^5) tl <- TLstatistics(x[,,1],xc) TLevaluate(tl)
Function to plot the results of the automatic validation procedure as a traffic light symbol
TLplot(mode, detailed = TRUE, linesize = 0.5)
TLplot(mode, detailed = TRUE, linesize = 0.5)
mode |
A matrix containing traffic light values
returned by |
detailed |
boolean deciding whether detailed information should be plotted or not. In detailed mode each block represents a test group with the first traffic light showing the overall performance in this group and the following traffic lights showing the results of single tests. |
linesize |
line size of the traffic light borders |
A ggplot object.
Jan Philipp Dietrich, Markus Bonsch
TLevaluate
,TLstatistics
,trafficlight
library(magclass) data("population_magpie") x <- population_magpie xc <- x + runif(length(x)[1],-10^5,10^5) tl <- TLstatistics(x[,,1],xc) tle <- TLevaluate(tl) TLplot(tle)
library(magclass) data("population_magpie") x <- population_magpie xc <- x + runif(length(x)[1],-10^5,10^5) tl <- TLstatistics(x[,,1],xc) tle <- TLevaluate(tl) TLplot(tle)
Calculates several statistical measures to compare model results with data.
TLstatistics(x, xc)
TLstatistics(x, xc)
x |
model output which should be tested in magclass format. Only a single element in data dimension is allowed |
xc |
comparison data on which x should be tested (magclass format) |
Details about the employed tests can be found here: https://redmine.pik-potsdam.de/projects/magpie-intern/wiki/Traffic_light_validation
A matrix containing results of multiple tests for all available comparison datasets.
Markus Bonsch, Jan Philipp Dietrich
TLevaluate
,trafficlight
,TLplot
library(magclass) data("population_magpie") x <- population_magpie xc <- x + runif(length(x)[1],0,10^5) TLstatistics(x[,,1],xc)
library(magclass) data("population_magpie") x <- population_magpie xc <- x + runif(length(x)[1],0,10^5) TLstatistics(x[,,1],xc)
Function to perform an automatic validation routine
trafficlight(x, xc, plot = TRUE, ...)
trafficlight(x, xc, plot = TRUE, ...)
x |
model output which should be tested in magclass format |
xc |
comparison data on which x should be tested (magclass format) |
plot |
TRUE or FALSE. If TRUE, a plot with a visualization of te treffic light is returned. If FALSE, a MAgPIE object with the test result is returned. |
... |
Additional arguments provided to |
The procedure is explained in detail here: https://redmine.pik-potsdam.de/projects/magpie-intern/wiki/Traffic_light_validation
If plot==TRUE
, a ggplot object. If plot==FALSE
, a
matrix with traffic light result (0 = red, 1 = yellow, 2 = green)
Markus Bonsch, Jan Philipp Dietrich, Benjamin Leon Bodirsky
TLevaluate
,TLstatistics
,TLplot
library(magclass) data("population_magpie") x <- population_magpie xc <- x + runif(length(x)[1],0,10^5) trafficlight(x[,,1], xc) trafficlight(x[,,1], xc, detailed=FALSE)
library(magclass) data("population_magpie") x <- population_magpie xc <- x + runif(length(x)[1],0,10^5) trafficlight(x[,,1], xc) trafficlight(x[,,1], xc, detailed=FALSE)