Compare means, distributions, and correlations of different datasets

Share:

Description

Plots a pirateplot with couulors according to model performance. The function can be used to compare means, distributions, and correlations (or any other metric from ObjFct) between different datasets and models. Thus this plot is almost an "eier-legende Wollmichsau" (german, animal that produces eggs, wool, milk and meet) for model-data comparison. The plot is based on the function pirateplot

Usage

1
2
3
4
5
WollMilchSauPlot(x, ref = 1, objfct = "Cor", cols = tim.colors(10), 
    brks = NULL, names = NULL, main = NULL, xlab = NULL, ylab = NULL, 
    xlim = NULL, ylim = NULL, legend = TRUE, legend.only = FALSE, 
    point.pch = NA, bar.o = 1, bean.o = 1, inf.o = 0, bean.lwd = 1, 
    line.lwd = 1, cut.min = NULL, cut.max = NULL, ...)

Arguments

x

a data.frame with at least two columns

ref

Which column in x is the reference dataset? Also more than one reference can be provided, e.g. ref = c(1,2) will compute the objfct based on the combination of both datasets.

objfct

Which objective function metric should be used to create the colour palette? (see ObjFct)

cols

vector of colors from which the color palette should be interpolated

brks

break for colour scale

names

names of the datasets

main

title of the plot

xlab

label for x-axis

ylab

label for y-axis

xlim

limits for x-axis

ylim

limits for y-axis

legend

plot a legend?

legend.only

plot only a legend?

point.pch

point types, default: no points

bar.o

opacity of bars

bean.o

opacity of beans

inf.o

inference bands

bean.lwd

line width of beans

line.lwd

line width of lines

cut.min

Optional minimum value of the beans.

cut.max

Optional maximum value of the beans.

...

further arguments to pirateplot

Details

No details.

Author(s)

Matthias Forkel <matthias.forkel@geo.tuwien.ac.at> [aut, cre]

References

No reference.

See Also

pirateplot, ObjFct, TaylorPlot, WollMilchSauPlot, ScatterPlot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# create some data
obs <- rlnorm(500, 1, 1) # observations
sim1 <- obs * rnorm(500, 1, 0.5) # similar to obs
sim2 <- obs * rnorm(500, 1, 2) # less similar to obs
sim3 <- obs * rnorm(500, 1, 4) # less similar to obs
sim4 <- rlnorm(500, 1, 1) # same distribution but no correlation
sim5 <- rnorm(500, 4.4, 2) # similar mean but different distribution
x <- data.frame(obs, sim1, sim2, sim3, sim4, sim5)
x[x < 0] <- 0

# default plot
WollMilchSauPlot(x)

# with different objective function as colour
WollMilchSauPlot(x, objfct="IoA")
WollMilchSauPlot(x, objfct="Pbias")
WollMilchSauPlot(x, objfct="FV")

# some other settings, e.g. with plotting points
WollMilchSauPlot(x, ylab="Area (km2)", xlab="Groups", main="Comparison", 
 point.pch=16, bar.o=0.5, point.o=0.4)

# different color palettes
WollMilchSauPlot(x, cols=c("blue", "red"))
WollMilchSauPlot(x, cols=rainbow(10))
WollMilchSauPlot(x, cols=heat.colors(5))

# without legend (but using an objective function to colour)
WollMilchSauPlot(x, legend=FALSE)

# only legend
WollMilchSauPlot(x, legend.only=TRUE)

# without using an objective function 
WollMilchSauPlot(x, objfct=NULL)

# different example data
obs <- rnorm(500, 5, 1)
sim1 <- obs * rnorm(500, 1, 0.2) # similar to obs
sim2 <- obs * rnorm(500, 2, 1) # bias
sim3 <- obs * rlnorm(500, 1, 0.1) # less similar to obs but highly correlated
x <- data.frame(obs, sim1, sim2, sim3)
WollMilchSauPlot(x)