Title: | A 'ggplot2'-Plot of Composition of Solvency II SCR: SF and IM |
Version: | 0.1.2 |
Date: | 2019-01-02 |
Description: | An implementation of 'ggplot2'-methods to present the composition of Solvency II Solvency Capital Requirement (SCR) as a series of concentric circle-parts. Solvency II (Solvency 2) is European insurance legislation, coming in force by the delegated acts of October 10, 2014. https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=OJ%3AL%3A2015%3A012%3ATOC. Additional files, defining the structure of the Standard Formula (SF) method of the SCR-calculation are provided. The structure files can be adopted for localization or for insurance companies who use Internal Models (IM). Options are available for combining smaller components, horizontal and vertical scaling, rotation, and plotting only some circle-parts. With outlines and connectors several SCR-compositions can be compared, for example in ORSA-scenarios (Own Risk and Solvency Assessment). |
Depends: | R (≥ 3.5.0) |
License: | GPL-3 |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 6.1.1 |
Imports: | dplyr, ggplot2, magrittr, tidyr |
Suggests: | covr, ggmap, knitr, rmarkdown, testthat |
VignetteBuilder: | knitr |
URL: | https://github.com/vanzanden/ggsolvencyii |
BugReports: | https://github.com/vanzanden/ggsolvencyii/issues |
NeedsCompilation: | no |
Packaged: | 2019-01-03 18:35:58 UTC; micro |
Author: | Marco van Zanden [aut, cre] |
Maintainer: | Marco van Zanden <git@vanzanden.nl> |
Repository: | CRAN |
Date/Publication: | 2019-01-04 12:10:03 UTC |
geom_sii_riskconnection
Description
returns a 'ggplot2' object, based on geom_segment.; it plots a line between (x and y coordinates of) those datapoints which have a matching value in the columns 'id' and 'comparewithid'. values in 'id' must be unique. For values in 'comparewithid' is uniqueness not required, but a matching value in 'id' must be present.
Usage
geom_sii_riskconnection(data = NULL, mapping = NULL,
stat = "sii_riskconnection", position = "identity", na.rm = FALSE,
show.legend = NA, inherit.aes = TRUE, ...)
Arguments
data |
the dataset in tidyverse format (column 'description' as a factor). see examples in |
mapping |
required aes(thetics) : 'x' (i.e. time, longitude, integer), 'y' (i.e SCR ratio, lattitude), 'id' and also 'comparewithid' |
stat |
default stat is statsii_riskconnection, combinations with other stat's are not tested |
position |
standard ggplot function |
na.rm |
standard ggplot function |
show.legend |
standard ggplot function |
inherit.aes |
standard ggplot function |
... |
ellipsis, a standard R parameter |
Value
a 'ggplot2' object based on 'geom_polygon'
Examples
library(ggsolvencyii)
library(ggplot2)
sii_z_ex3_data[sii_z_ex3_data$description == "SCR", ]
ggplot() + geom_sii_riskconnection(data = sii_z_ex3_data, mapping = aes(
comparewithid = comparewithid,
x = time,
y = ratio,
id = id,
),
color = "red",
lwd = 0.7,
arrow = arrow()
)
geom_sii_riskoutline
Description
returns a 'ggplot2' object, based on geom_path with the outlines concentric circle(part)s, defined by the values in a hierarchy of levels. This can be used instead of geom_sii_risksurface to plot the composition of the SCR. When optional aes(thetic) 'comparewithid' is passed to the geom_sii_riskoutline then the second SCR can be an overlay over another, for easy comparison.
Usage
geom_sii_riskoutline(data = NULL, mapping = NULL,
stat = "sii_riskoutline",
structure = ggsolvencyii::sii_structure_sf16_eng, squared = FALSE,
levelmax = 99, aggregatesuffix = "_other", plotdetails = NULL,
rotationdegrees = NULL, rotationdescription = NULL,
maxscrvalue = NULL, scalingx = 1, scalingy = 1,
position = "identity", na.rm = FALSE, show.legend = NA,
inherit.aes = TRUE, ...)
Arguments
data |
the dataset in tidyverse format (column 'description' as a factor). see examples in |
mapping |
required aes(thetics) : 'x' (i.e. time, longitude, integer), 'y' (i.e SCR ratio, lattitude), 'id', 'description', 'value'. Optional aes is 'comparewithid' |
stat |
default stat is statsii_riskoutline, combinations with other stat's are not tested |
structure |
(dataframe: default =
. In the standard formula structure, SCR has level 1, with childlevel 2. This means it consists of all datalines with level == 2, ie. "BSCR", "operational" and "Adjustment-LACDT". lines in the dataset with a suffix "d" behind the levelnumber are diversification items. As of now these are not used in any calculation. the values in column "description" in the dataset need to match the description in this file. The package contains also a file |
squared |
(optional, boolean, default = FALSE) |
levelmax |
(integer or dataframe, default = 99) |
aggregatesuffix |
(string, default = "_other") |
plotdetails |
a table with columns 'levelordescription' and 'outline1' to 'outline4', indicating which outlines of which circle elements to plot. When no table is provided all segments are plotted. example 3 shows how to combine geom_sii_risksurface and geom_sii_riskoutline by using using table |
rotationdegrees |
(optional, integer, -360 to 360, default = NULL) |
rotationdescription |
(optional, string, default = NULL) |
maxscrvalue |
(optional, double, default = NULL) |
scalingx |
(optional, positive value ,default = 1) |
scalingy |
(optional, positive value ,default = 1) |
position |
standard ggplot function |
na.rm |
standard ggplot function |
show.legend |
standard ggplot function |
inherit.aes |
standard ggplot function |
... |
ellipsis, a standard R parameter |
Details
When describing an outline of a circle part 4 segments can be distinguised, radial line outwards, outer circle segment, radial line inwards, inner circle segment. Whether or not to plot these lines can be determined with an outline dataframe. by means of the column aes()value comparewithid in the data an overlay can be made to compare two SCR representations.
Value
a 'ggplot2' object geom_sii_risksurface
Examples
library(ggsolvencyii)
library(ggplot2)
## see details about id and comparewithid
# sii_z_ex3_data[sii_z_ex3_data$description == "SCR", ]
ggplot()+
geom_sii_riskoutline(data = sii_z_ex3_data, mapping = aes(
# comparewithid = comparewithid,
x = time,
y = ratio,
value = value,
id = id,
description = description),
color = "red",
lwd = 0.7
)
##and with comparewithid in aes()
ggplot()+
geom_sii_riskoutline(data = sii_z_ex3_data, mapping = aes(
comparewithid = comparewithid,
x = time,
y = ratio,
value = value,
id = id,
description = description),
color = "red",
lwd = 0.7
)
geom_sii_risksurface
Description
returns a 'ggplot2' object, based on geom_polygon, with filled, concentric circle(part)s, defined by the values in a hierarchy of levels.
Usage
geom_sii_risksurface(data = NULL, mapping = NULL,
stat = "sii_risksurface",
structure = ggsolvencyii::sii_structure_sf16_eng, squared = FALSE,
levelmax = 99, aggregatesuffix = "_other", plotdetails = NULL,
rotationdegrees = NULL, rotationdescription = NULL,
maxscrvalue = NULL, scalingx = 1, scalingy = 1,
position = "identity", na.rm = FALSE, show.legend = NA,
inherit.aes = TRUE, ...)
Arguments
data |
the dataset in tidyverse format (column 'description' as a factor). see examples in |
mapping |
required aes(thetics) : x (i.e. time, longitude), y (i.e SCR ratio, lattitude), id, description (), value |
stat |
default stat is statsii_risksurface, combinations with other stat's are not tested |
structure |
(dataframe: default =
. In the standard formula structure, SCR has level 1, with childlevel 2. This means it consists of all datalines with level == 2, ie. "BSCR", "operational" and "Adjustment-LACDT". lines in the dataset with a suffix "d" behind the levelnumber are diversification items. As of now these are not used in any calculation. the values in column "description" in the dataset need to match the description in this file. The package contains also a file |
squared |
(optional, boolean, default = FALSE) |
levelmax |
(integer or dataframe, default = 99) |
aggregatesuffix |
(string, default = "_other") |
plotdetails |
(optional) a table with columns 'levelordescription' and 'surface', indicating which circle elements to plot. When no table is provided all segments are plotted. example 3 shows how to combine geom_sii_risksurface and geom_sii_riskoutline by using using table |
rotationdegrees |
(optional, integer, -360 to 360, default = NULL) |
rotationdescription |
(optional, string, default = NULL) |
maxscrvalue |
(optional, double, default = NULL) |
scalingx |
(optional, positive value ,default = 1) |
scalingy |
(optional, positive value ,default = 1) |
position |
standard ggplot function |
na.rm |
standard ggplot function |
show.legend |
standard ggplot function |
inherit.aes |
standard ggplot function |
... |
ellipsis, a standard R parameter |
Value
a ggplot object
Examples
## dataset human readable
library(ggsolvencyii)
library(ggplot2)
t <- tidyr::spread(data = sii_z_ex1_data, key = description, value = value)
t <- as.data.frame(t)
t <- t[order(t$id),]
t <- dplyr::select( t, id, time, comparewithid, ratio, SCR, dplyr::everything())
t[1:3 ,1:8]
ggplot() +
geom_sii_risksurface(
data = sii_z_ex1_data[sii_z_ex1_data$id == 1, ],
mapping = aes(x = time,
y = ratio,
id = id,
value = value,
description = description,
color = description,
fill = description
) ) +
theme_bw() +
scale_fill_manual(name = "Risks",values = sii_x_fillcolors_sf16_eng) +
scale_color_manual(name = "Risks",values = sii_x_edgecolors_sf16_eng)
ggplot() +
geom_sii_risksurface(
data = sii_z_ex2_data,
mapping = aes(x = time, y = ratio, id = id, value = value,
description = description,
# color = description,
fill = description
),
color = "black",
levelmax = sii_levelmax_sf16_993) +
theme_bw() +
scale_fill_manual(name = "Risks",values = sii_x_fillcolors_sf16_eng) # +
# scale_color_manual(name = "Risks",values = sii_x_edgecolors_sf16_eng)
ggplot() +
geom_sii_risksurface(data = sii_z_ex1_data[sii_z_ex1_data$id == 1, ],
mapping = ggplot2::aes(x = time,
y = ratio,
## x and y could for example be
## longitude and latitude
## in combination with plotted map
value = value,
id = id,
description = description,
fill = description, ## optional
color = description ## optional
),
## all parameters are shown here,
## the values behind the outcommented are the default values
## how and what
## structure = sii_structure_sf16_eng,
## plotdetails = NULL,
## grouping
# levelmax = 99,
# aggregatesuffix = "other",
## scaling
# maxscrvalue = NULL,
# scalingx = 1,
# scalingy = 1,
## rotation and squared
# rotationdegrees = NULL,
# rotationdescription = NULL,
# squared = FALSE,
## cosmetic
lwd = 0.25,
# alpha = 1
) +
theme_bw() +
scale_fill_manual(name = "risks", values = sii_z_ex1_fillcolors) +
scale_color_manual(name = "risks", values = sii_z_ex1_edgecolors)
sii_debug_geom
Description
assists in finding level or description mismatches in a set parameter(tables)
Usage
sii_debug_geom(data_descriptionvector,
structure = ggsolvencyii::sii_structure_sf16_eng,
aggregatesuffix = "other", levelmax = NULL, plotdetails = NULL,
fillcolors = NULL, edgecolors = NULL)
Arguments
data_descriptionvector |
(no default) the vector 'description' from the data |
structure |
(no default) the structure dataframe |
aggregatesuffix |
(optional, default = "_other"): |
levelmax |
(optional, no default): the levelmax dataframe, when not filled the expanded structure assumes levelmax was set to 99 for all levels. |
plotdetails |
(optional, no default): the plotdetails dataframe |
fillcolors |
(optional, no default): fillcolor parameter (list with items "description" = "color" where color can be a name, #hexcode or other ) |
edgecolors |
(optional, no default): edgecolor parameter (list with items "description" = "color" where color can be a name, #hexcode or other ) |
Value
prints two comparison tables and puts them in $debug_description and $debug_level
sii_levelmax_sf16_993
Description
maximum number of items in a level, 99 items for levels 1-3 (SCR, BSCR/OR/ADJ, Market/life/... risks) and 3 items for lower level risk (equity/longevity/...) in a standard formula structure.
Usage
sii_levelmax_sf16_993
Format
A data frame with columns:
- level
string with format 'level(numeric)' [<point> 'sublevel(numeric)'] ['d'] i.e. 1, 2.01, 3.1d where d indicates a diversification component
- levelmax
positive integer indicating the total number of components to be shown in a level, consisting of the x-1 largest components and the remaining components combined in one other
Source
made from excel-file in github.com/vanzanden :
Examples
installedtable <- sii_levelmax_sf16_993
installedtable
sii_levelmax_sf16_995
Description
maximum number of items in a level, 99 items for levels 1-3 (SCR, BSCR/OR/ADJ, Market/life/... risks) and 5 items for lower level risk (equity/longevity/...) in a standard formula structure.
Usage
sii_levelmax_sf16_995
Format
A data frame with columns:
- level
string with format 'level(numeric)' [<point> 'sublevel(numeric)'] ['d'] i.e. 1, 2.01, 3.1d where d indicates a diversification component
- levelmax
positive integer indicating the total number of components to be shown in a level, consisting of the x-1 largest components and the remaining components combined in one other
Source
made from excel-file in github.com/vanzanden, from there transfered to R environment with code in preparingtables.R
.
Examples
installedtable <- sii_levelmax_sf16_995
installedtable
sii_plotdetails_sf16
Description
A table for geom_sii_risksurface
and geom_sii_riskoutline
indicating which outlines of each item should be shown, specified per level and/or description. the latter overrule the former.
when defining an item (or the squared = TRUE
transformation) 4 lines can be distinguished, a radialline going outwards, a circle segment (clockwise), a radialline going inwards, a circle segment (counterclockwise). These are numbered as outline1 to outline4.
Usage
sii_plotdetails_sf16
Format
A data frame with columns:
- levelordescription
string with format 'level(numeric)' [<point> 'sublevel(numeric)'] ['d'] i.e. 1, 2.01, 3.1d where d indicates a diversification component AND/OR description(s) from the corresponding structure
- surface
boolean (logical): the surface
- outline1
boolean (logical): the radial line
- outline2
boolean (logical): the outer line
- outline3
boolean (logical): the radial line
- outline4
boolean (logical): the inner line
- outline11
NOT YET IMPLEMENTED: boolean (logical): analogue to outline1, but but only for the first plotted component of that level. The components in each level are plotted clockwise
- outline13
NOT YET IMPLEMENTED: boolean (logical): analogue to outline3, but but only for the last plotted component of that level.
Source
determined based on specification of EIOPA standard formula Solvency II structure
made from excel-file in github.com/vanzanden, from there transfered to R environment with code in preparingtables.R
.
Examples
installedtable <- sii_plotdetails_sf16
installedtable
sii_structure_sf16_eng
Description
a standard formula structure (as of 2016), with descriptions in English.
Usage
sii_structure_sf16_eng
Format
A data frame with columns:
- description
string: the name of the component
- level
string with format 'level(numeric)' [<point> 'sublevel(numeric)'] ['d'] i.e. 1, 2.01, 3.1d where d indicates a diversification component
- childlevel
string, same format as level, indicating the level of which the components combine into this level
Source
determined based on specification of EIOPA standard formula Solvency II structure.
made from excel-file in github.com/vanzanden, from there transfered to R environment with code in preparingtables.R
.
Examples
installedtable <- sii_structure_sf16_eng
installedtable
sii_structure_sf16_nld
Description
a standard formula structure (as of 2016), with descriptions in Dutch.
Usage
sii_structure_sf16_nld
Format
A data frame with columns:
- description
string: the name of the component
- level
string with format 'level(numeric)' [<point> 'sublevel(numeric)'] ['d'] i.e. 1, 2.01, 3.1d where d indicates a diversification component
- childlevel
string, same format as level, indicating the level of which the components combine into this level
Source
determined based on specification of EIOPA standard formula Solvency II structure.
made from excel-file in github.com/vanzanden, from there transfered to R environment with code in preparingtables.R
.
Examples
installedtable <- sii_structure_sf16_nld
installedtable
sii_x_edgecolors_sf16_eng
Description
a colorset, as named list, where each risk has the edgecolor of the "motherlevel", as defined in the ..fillcolors..
variable.
Usage
sii_x_edgecolors_sf16_eng
Format
A list with items in the form "description"= "#colorcode":
Source
made with preparingtables.R
(not included in this package) which can be found on github.com/vanzanden/ggsolvencyii
Examples
installedtable <- sii_x_edgecolors_sf16_eng
installedtable
sii_x_edgecolors_sf16_nld
Description
a colorset, as named list, where each risk has the edgecolor of the "motherlevel", as defined in the ..fillcolors..
variable.
Usage
sii_x_edgecolors_sf16_nld
Format
A list with items in the form "description"= "#colorcode":
Source
made with preparingtables.R
(not included in this package) which can be found on github.com/vanzanden/ggsolvencyii
Examples
installedtable <- sii_x_edgecolors_sf16_nld
installedtable
sii_x_fillcolors_sf16_eng
Description
a colorset, as named list, where each accumulationlevel and each type of risk has it's own color, where ".._other" has the same color as the "motherlevel", i.e. 'market_other' has the same color as 'market' while other 'm_..' risks have a different hue.
Usage
sii_x_fillcolors_sf16_eng
Format
A list with items in the form "description"= "#colorcode":
Source
made with preparingtables.R
(not included in this package) which can be found on github.com/vanzanden/ggsolvencyii
Examples
installedtable <- sii_x_fillcolors_sf16_eng
installedtable
sii_x_fillcolors_sf16_nld
Description
a colorset, as named list, where each accumulationlevel and each type of risk has it's own color, where ".._other" has the same color as the "motherlevel", i.e. 'market_other' has the same color as 'market' while other 'm_..' risks have a different hue.
Usage
sii_x_fillcolors_sf16_nld
Format
A list with items in the form "description"= "#colorcode":
Source
made with preparingtables.R
(not included in this package) which can be found on github.com/vanzanden/ggsolvencyii
Examples
installedtable <- sii_x_fillcolors_sf16_nld
installedtable
sii_z_ex1_data
Description
example dataset, in tidyverse format, for the showcase of a limited structure.
Usage
sii_z_ex1_data
Format
A data frame with columns:
- time
numerical: a representation of an x value:
The x aesthetic could also be a normal numbering, or a longitude- ratio
numerical: solvency II ratio, a representation of an y value:
y aesthetic could also be a lattitude- description
character: component of the structure
- id
number: a grouping item
- value
numerical: positive for risks, negative for diversification effects
- comparewithid
numerical: a reference to the id of another datapoint
#'
Source
loosely based on public SFCR report of a medium sized dutch life insurer
made from excel-file in github.com/vanzanden, from there transfered to R environment with code in preparingtables.R
.
Examples
installedtable <- sii_z_ex1_data
installedtable
sii_z_ex1_edgecolors
Description
a colorset, as named list, where each risk has the edgecolor of the "motherlevel", as defined in the ..fillcolors..
variable.
Usage
sii_z_ex1_edgecolors
Format
A list with items in the form "description"= "#colorcode":
Source
made with preparingtables.R
(not included in this package) which can be found on github.com/vanzanden/ggsolvencyii
Examples
installedtable <- sii_z_ex1_edgecolors
installedtable
sii_z_ex1_fillcolors
Description
a colorset, as named list, where each accumulationlevel and each type of risk has it's own color, where ".._other" has the same color as the "motherlevel", i.e. 'market_other' has the same color as 'market' while other 'm_..' risks have a different hue.
Usage
sii_z_ex1_fillcolors
Format
A list with items in the form "description"= "#colorcode":
Source
made with preparingtables.R
(not included in this package) which can be found on github.com/vanzanden/ggsolvencyii
Examples
installedtable <- sii_z_ex1_fillcolors
installedtable
sii_z_ex1_levelmax
Description
maximum number of items in a level, 99 items for levels 1-3 (SCR, BSCR/OR/ADJ, Market/life/... risks) and 3 items for lower level risk (equity/longevity/...)
Usage
sii_z_ex1_levelmax
Format
A data frame with columns:
Source
made from excel-file in github.com/vanzanden, from there transfered to R environment with code in preparingtables.R
.
Examples
installedtable <- sii_z_ex1_levelmax
installedtable
sii_z_ex1_plotdetails
#'
A table for geom_sii_risksurface
and geom_sii_riskoutline
indicating which outlines of each item should be shown, specified per level and/or description. the latter overrule the former.
when defining an item (or the squared = TRUE
transformation) 4 lines can be distinguished, a radialline going outwards, a circle segment (clockwise), a radialline going inwards, a circle segment (counterclockwise). These are numbered as outline1 to outline4.
Description
sii_z_ex1_plotdetails
#'
A table for geom_sii_risksurface
and geom_sii_riskoutline
indicating which outlines of each item should be shown, specified per level and/or description. the latter overrule the former.
when defining an item (or the squared = TRUE
transformation) 4 lines can be distinguished, a radialline going outwards, a circle segment (clockwise), a radialline going inwards, a circle segment (counterclockwise). These are numbered as outline1 to outline4.
Usage
sii_z_ex1_plotdetails
Format
A data frame with columns:
- levelordescription
string with format 'level(numeric)' [<point> 'sublevel(numeric)'] ['d'] i.e. 1, 2.01, 3.1d where d indicates a diversification component AND/OR description(s) from the corresponding structure
- surface
boolean (logical): the surface
- outline1
boolean (logical): the radial line
- outline2
boolean (logical): the outer line
- outline3
boolean (logical): the radial line
- outline4
boolean (logical): the inner line
- outline11
NOT YET IMPLEMENTED: boolean (logical): analogue to outline1, but but only for the first plotted component of that level. The components in each level are plotted clockwise
- outline13
NOT YET IMPLEMENTED: boolean (logical): analogue to outline3, but but only for the last plotted component of that level.
Source
determined based on specification of EIOPA standard formula Solvency II structure
made from excel-file in github.com/vanzanden, from there transfered to R environment with code in preparingtables.R
.
Examples
installedtable <- sii_z_ex1_plotdetails
installedtable
sii_z_ex1_plotdetails2
#'
A table for geom_sii_risksurface
and geom_sii_riskoutline
indicating which outlines of each item should be shown, specified per level and/or description. the latter overrule the former.
when defining an item (or the squared = TRUE
transformation) 4 lines can be distinguished, a radialline going outwards, a circle segment (clockwise), a radialline going inwards, a circle segment (counterclockwise). These are numbered as outline1 to outline4.
Description
sii_z_ex1_plotdetails2
#'
A table for geom_sii_risksurface
and geom_sii_riskoutline
indicating which outlines of each item should be shown, specified per level and/or description. the latter overrule the former.
when defining an item (or the squared = TRUE
transformation) 4 lines can be distinguished, a radialline going outwards, a circle segment (clockwise), a radialline going inwards, a circle segment (counterclockwise). These are numbered as outline1 to outline4.
Usage
sii_z_ex1_plotdetails2
Format
A data frame with columns:
- levelordescription
string with format 'level(numeric)' [<point> 'sublevel(numeric)'] ['d'] i.e. 1, 2.01, 3.1d where d indicates a diversification component AND/OR description(s) from the corresponding structure
- surface
boolean (logical): the surface
- outline1
boolean (logical): the radial line
- outline2
boolean (logical): the outer line
- outline3
boolean (logical): the radial line
- outline4
boolean (logical): the inner line
- outline11
NOT YET IMPLEMENTED: boolean (logical): analogue to outline1, but but only for the first plotted component of that level. The components in each level are plotted clockwise
- outline13
NOT YET IMPLEMENTED: boolean (logical): analogue to outline3, but but only for the last plotted component of that level.
Source
determined based on specification of EIOPA standard formula Solvency II structure
made from excel-file in github.com/vanzanden, from there transfered to R environment with code in preparingtables.R
.
Examples
installedtable <- sii_z_ex1_plotdetails2
installedtable
sii_z_ex1_structure
Description
a adapted (compact) structure, for a life-insurer with only market and life risk and their subrisks
Usage
sii_z_ex1_structure
Format
A data frame with columns:
- description
string: the name of the component, or a diversification
- level
string with format 'level(numeric)' [<point> 'sublevel(numeric)'] ['d'] i.e. 1, 2.01, 3.1d where d indicates a diversification component
- childlevel
string of the same format as level, indicating the level of which the components make up this item
Source
determined based on specification of EIOPA standard formula Solvency II structure
made from excel-file in github.com/vanzanden, from there transfered to R environment with code in preparingtables.R
.
Examples
installedtable <- sii_z_ex1_structure
installedtable
sii_z_ex2_data
Description
example dataset, in tidyverse format, with only one instance of a limited filled sf structure.
Usage
sii_z_ex2_data
Format
A data frame with columns:
- time
numerical: a representation of an x value:
The x aesthetic could also be a normal numbering, or a longitude- ratio
numerical: solvency II ratio, a representation of an y value:
y aesthetic could also be a lattitude- description
character: component of the structure
- id
number: a grouping item
- value
numerical: positive for risks, negative for diversification effects
Source
loosely based on public SFCR report of a medium sized dutch life insurer
made from excel-file in github.com/vanzanden, from there transfered to R environment with code in preparingtables.R
.
Examples
installedtable <- sii_z_ex2_data
installedtable
sii_z_ex3_data
Description
example dataset, in tidyverse format, with all columns of the complete SF16 structure present in the data but with only a few risks filled with non-zero values,
Usage
sii_z_ex3_data
Format
A data frame with columns:
- time
numerical: a representation of an x value:
The x aesthetic could also be a normal numbering, or a longitude- ratio
numerical: solvency II ratio, a representation of an y value:
y aesthetic could also be a lattitude- description
character: component of the structure
- id
number: a grouping item
- value
numerical: positive for risks, negative for diversification effects
- comparewithid
numerical: a reference to the id of another datapoint
Source
loosely based on public SFCR report of a medium sized dutch life insurer
made from excel-file in github.com/vanzanden, from there transfered to R environment with code in preparingtables.R
.
Examples
installedtable <- sii_z_ex3_data
installedtable
sii_z_ex3_plotdetails
#'
A table for geom_sii_risksurface
and geom_sii_riskoutline
indicating which outlines of each item should be shown, specified per level and/or description. the latter overrule the former.
when defining an item (or the squared = TRUE
transformation) 4 lines can be distinguished, a radialline going outwards, a circle segment (clockwise), a radialline going inwards, a circle segment (counterclockwise). These are numbered as outline1 to outline4.
Description
sii_z_ex3_plotdetails
#'
A table for geom_sii_risksurface
and geom_sii_riskoutline
indicating which outlines of each item should be shown, specified per level and/or description. the latter overrule the former.
when defining an item (or the squared = TRUE
transformation) 4 lines can be distinguished, a radialline going outwards, a circle segment (clockwise), a radialline going inwards, a circle segment (counterclockwise). These are numbered as outline1 to outline4.
Usage
sii_z_ex3_plotdetails
Format
A data frame with columns:
- levelordescription
string with format 'level(numeric)' [<point> 'sublevel(numeric)'] ['d'] i.e. 1, 2.01, 3.1d where d indicates a diversification component AND/OR description(s) from the corresponding structure
- surface
boolean (logical): the surface
- outline1
boolean (logical): the radial line
- outline2
boolean (logical): the outer line
- outline3
boolean (logical): the radial line
- outline4
boolean (logical): the inner line
- outline11
NOT YET IMPLEMENTED: boolean (logical): analogue to outline1, but but only for the first plotted component of that level. The components in each level are plotted clockwise
- outline13
NOT YET IMPLEMENTED: boolean (logical): analogue to outline3, but but only for the last plotted component of that level.
Source
determined based on specification of EIOPA standard formula Solvency II structure
made from excel-file in github.com/vanzanden, from there transfered to R environment with code in preparingtables.R
.
Examples
installedtable <- sii_z_ex3_plotdetails
installedtable
sii_z_ex4_data
Description
example dataset, in tidyverse format, with several instances of a filled sf structure,
Usage
sii_z_ex4_data
Format
A data frame with columns:
- time
numerical: a representation of an x value:
The x aesthetic could also be a normal numbering, or a longitude- ratio
numerical: solvency II ratio, a representation of an y value:
y aesthetic could also be a lattitude- description
character: component of the structure
- id
number: a grouping item
- value
numerical: positive for risks, negative for diversification effects
- comparewithid
numerical: a reference to the id of another datapoint
#'
Source
based on public SFCR 2017 reports of a medium sized dutch life insurer in Oosterhout
made from excel-file in github.com/vanzanden, from there transfered to R environment with code in preparingtables.R
.
Examples
installedtable <- sii_z_ex4_data
installedtable
sii_z_ex4_levelmax
Description
maximum number of items in a level, 99 items for levels 1-3 (SCR, BSCR/OR/ADJ, Market/life/... risks) and 3 items for lower level risk (equity/longevity/...)
Usage
sii_z_ex4_levelmax
Format
A data frame with columns:
Source
made from excel-file in github.com/vanzanden, from there transfered to R environment with code in preparingtables.R
.
Examples
installedtable <- sii_z_ex4_levelmax
installedtable
sii_z_ex4_structure
Description
a adapted (compact) structure with no division of market, life, .. risks in subrisks (i.e. equity, longevity,... ). Descriptions are in English
Usage
sii_z_ex4_structure
Format
A data frame with columns:
- description
string: the name of the component, or a diversification
- level
string with format 'level(numeric)' [<point> 'sublevel(numeric)'] ['d'] i.e. 1, 2.01, 3.1d where d indicates a diversification component
- childlevel
string of the same format as level, indicating the level of which the components make up this item
Source
determined based on specification of EIOPA standard formula Solvency II structure
made from excel-file in github.com/vanzanden, from there transfered to R environment with code in preparingtables.R
.
Examples
installedtable <- sii_z_ex4_structure
installedtable
sii_z_ex6_data
Description
example dataset of a internal model of a large Dutch insurer (NN group). Values are fictious
Usage
sii_z_ex6_data
Format
A data frame with columns:
- time
numerical: a representation of an x value:
The x aesthetic could also be a normal numbering, or a longitude- ratio
numerical: solvency II ratio, a representation of an y value:
y aesthetic could also be a lattitude- description
character: component of the structure
- id
number: a grouping item
- value
numerical: positive for risks, negative for diversification effects
- comparewithid
numerical: a reference to the id of another datapoint
Source
the structure is based on public SFCR 2017 report of NN group,
with a possible wrong interpretation of diversification effects towards 'market basis and CPD risk'
#' See preview.tinyurl.com/ggsolvencyii-001, page 33 linking to
www.nn-group.com /nn-group /file?uuid=e3e89829 -e7bd -495a -9fed
-4bc54a9349eb&owner =c5df72fd -8a65 -4f75 -956d -5e37307aa50c &contentid =2311
made from excel-file in github.com/vanzanden,
from there transfered to R environment with code in preparingtables.R
in the same directory.
Examples
installedtable <- sii_z_ex6_data
installedtable
sii_z_ex6_data2
Description
example dataset of a internal model of a large Dutch insurer (NN group). Values are fictious.
To show 'counterparty default risk (CPD)' separate from the two components
'type 1' and 'type 2' the following assumption is made: The (fictious)
diversification towards the higher level from CPD risk is transferred
to a position between CPD and its two components.
A similar approach is used to show 'business risk',
'life risk', 'morbidity risk' and 'non-life risk'
and their (7,4,4 and 4) components
Usage
sii_z_ex6_data2
Format
A data frame with columns:
- time
numerical: a representation of an x value:
The x aesthetic could also be a normal numbering, or a longitude- ratio
numerical: solvency II ratio, a representation of an y value:
y aesthetic could also be a lattitude- description
character: component of the structure
- id
number: a grouping item
- value
numerical: positive for risks, negative for diversification effects
- comparewithid
numerical: a reference to the id of another datapoint
#'
Source
the structure is based on public SFCR 2017 report of NN group,
with a possible wrong interpretation of diversification effects towards 'market basis and CPD risk'
#'
See preview.tinyurl.com/ggsolvencyii-001, page 33 linking to
www.nn-group.com/ nn-group/file? uuid=e3e89829 -e7bd -495a -9fed
-4bc54a9349eb&owner =c5df72fd -8a65 -4f75 -956d -5e37307aa50c &contentid =2311
made from excel-file in github.com/vanzanden,
from there transfered to R environment with code in preparingtables.R
in the same directory.
Examples
installedtable <- sii_z_ex6_data2
installedtable
sii_z_ex6_edgecolors
Description
a colorset, as named list, where each risk has the edgecolor of the "motherlevel", as defined in the ..fillcolors..
variable.
Usage
sii_z_ex6_edgecolors
Format
A list with items in the form "description"= "#colorcode":
Source
made with preparingtables.R
(not included in this package) which can be found on github.com/vanzanden/ggsolvencyii
Examples
installedtable <- sii_z_ex6_edgecolors
installedtable
sii_z_ex6_fillcolors
Description
a colorset, as named list, where each accumulation-level and each type of risk has it's own color, where ".._other" has the same color as the "motherlevel", i.e. 'market_other' has the same color as 'market' while other 'm_..' risks have a different hue.
Usage
sii_z_ex6_fillcolors
Format
A list with items in the form "description"= "#colorcode":
Source
made with preparingtables.R
(not included in this package) which can be found on github.com/vanzanden/ggsolvencyii
Examples
installedtable <- sii_z_ex6_fillcolors
installedtable
sii_z_ex6_levelmax
Description
maximum number of items in a level, 99 items for levels 1-3 (SCR, BSCR/OR/ADJ, Market/life/... risks) and 3 items for lower level risk (equity/longevity/...)
Usage
sii_z_ex6_levelmax
Format
A data frame with columns:
Source
made from excel-file in github.com/vanzanden, from there transfered to R environment with code in preparingtables.R
.
Examples
installedtable <- sii_z_ex6_levelmax
installedtable
sii_z_ex6_plotdetails
#'
A table for geom_sii_risksurface
and geom_sii_riskoutline
indicating which outlines of each item should be shown, specified per level and/or description. the latter overrule the former.
when defining an item (or the squared = TRUE
transformation) 4 lines can be distinguished, a radialline going outwards, a circle segment (clockwise), a radialline going inwards, a circle segment (counterclockwise). These are numbered as outline1 to outline4.
Description
sii_z_ex6_plotdetails
#'
A table for geom_sii_risksurface
and geom_sii_riskoutline
indicating which outlines of each item should be shown, specified per level and/or description. the latter overrule the former.
when defining an item (or the squared = TRUE
transformation) 4 lines can be distinguished, a radialline going outwards, a circle segment (clockwise), a radialline going inwards, a circle segment (counterclockwise). These are numbered as outline1 to outline4.
Usage
sii_z_ex6_plotdetails
Format
A data frame with columns:
- levelordescription
string with format 'level(numeric)' [<point> 'sublevel(numeric)'] ['d'] i.e. 1, 2.01, 3.1d where d indicates a diversification component AND/OR description(s) from the corresponding structure
- surface
boolean (logical): the surface
- outline1
boolean (logical): the radial line
- outline2
boolean (logical): the outer line
- outline3
boolean (logical): the radial line
- outline4
boolean (logical): the inner line
- outline11
NOT YET IMPLEMENTED: boolean (logical): analogue to outline1, but but only for the first plotted component of that level. The components in each level are plotted clockwise
- outline13
NOT YET IMPLEMENTED: boolean (logical): analogue to outline3, but but only for the last plotted component of that level.
Source
determined based on specification of EIOPA standard formula Solvency II structure
made from excel-file in github.com/vanzanden, from there transfered to R environment with code in preparingtables.R
.
Examples
installedtable <- sii_z_ex6_plotdetails
installedtable
sii_z_ex6_structure
Description
a standard formula structure (as of 2016), with descriptions in English.
Usage
sii_z_ex6_structure
Format
A data frame with columns:
- description
string: the name of the component
- level
string with format 'level(numeric)' [<point> 'sublevel(numeric)'] ['d'] i.e. 1, 2.01, 3.1d where d indicates a diversification component
- childlevel
string, same format as level, indicating the level of which the components combine into this level
Source
determined based on specification of EIOPA standard formula Solvency II structure.
made from excel-file in github.com/vanzanden, from there transfered to R environment with code in preparingtables.R
.
Examples
installedtable <- sii_z_ex6_structure
installedtable
sii_z_ex7_data
Description
example dataset, in tidyverse format, with all columns of the complete SF16 structure present in the data but with only a few risks filled with non-zero values,
Usage
sii_z_ex7_data
Format
A data frame with columns:
- tijd
numerical: a representation of an x value:
The x aesthetic could also be a normal numbering, or a longitude- ratio
numerical: solvency II ratio, a representation of an y value:
y aesthetic could also be a lattitude- description
character: component of the structure
- id
number: a grouping item
- waarde
numerical: positive for risks, negative for diversification effects
- vergelijkmet
numerical: a reference to the id of another datapoint
#'
Source
loosely based on public SFCR report of a medium sized dutch life insurer
made from excel-file in github.com/vanzanden, from there transfered to R environment with code in preparingtables.R
.
Examples
installedtable <- sii_z_ex7_data
installedtable
sii_z_ex7_plotdetails
#'
A table for geom_sii_risksurface
and geom_sii_riskoutline
indicating which outlines of each item should be shown, specified per level and/or description. the latter overrule the former.
when defining an item (or the squared = TRUE
transformation) 4 lines can be distinguished, a radialline going outwards, a circle segment (clockwise), a radialline going inwards, a circle segment (counterclockwise). These are numbered as outline1 to outline4.
Description
sii_z_ex7_plotdetails
#'
A table for geom_sii_risksurface
and geom_sii_riskoutline
indicating which outlines of each item should be shown, specified per level and/or description. the latter overrule the former.
when defining an item (or the squared = TRUE
transformation) 4 lines can be distinguished, a radialline going outwards, a circle segment (clockwise), a radialline going inwards, a circle segment (counterclockwise). These are numbered as outline1 to outline4.
Usage
sii_z_ex7_plotdetails
Format
A data frame with columns:
- levelordescription
string with format 'level(numeric)' [<point> 'sublevel(numeric)'] ['d'] i.e. 1, 2.01, 3.1d where d indicates a diversification component AND/OR description(s) from the corresponding structure
- surface
boolean (logical): the surface
- outline1
boolean (logical): the radial line
- outline2
boolean (logical): the outer line
- outline3
boolean (logical): the radial line
- outline4
boolean (logical): the inner line
- outline11
NOT YET IMPLEMENTED: boolean (logical): analogue to outline1, but but only for the first plotted component of that level. The components in each level are plotted clockwise
- outline13
NOT YET IMPLEMENTED: boolean (logical): analogue to outline3, but but only for the last plotted component of that level.
Source
determined based on specification of EIOPA standard formula Solvency II structure
made from excel-file in github.com/vanzanden, from there transfered to R environment with code in preparingtables.R
.
Examples
installedtable <- sii_z_ex7_plotdetails
installedtable
stat_sii_risksurface
Description
returns a 'ggplot2' object with filled, concentric circle(part)s, defined by the values of a hierarchy of levels.
Usage
stat_sii_risksurface(mapping = NULL, data = NULL,
geom = "sii_risksurface", position = "identity",
show.legend = TRUE, inherit.aes = TRUE, na.rm = FALSE,
levelmax = 99, structure = ggsolvencyii::sii_structure_sf16_eng,
maxscrvalue = NULL, aggregatesuffix = "_other", scalingx = 1,
scalingy = 1, rotationdegrees = NULL, rotationdescription = NULL,
squared = FALSE, plotdetails = NULL, ...)
Arguments
mapping |
required aes(thetics) : x (i.e. time, longitude), y (i.e SCR ratio, lattitude), id, description (), value |
data |
the dataset in tidyverse format (column 'description' as a factor). see examples in |
geom |
the default is geom_sii_risksurface |
position |
standard ggplot function |
show.legend |
standard ggplot function |
inherit.aes |
standard ggplot function |
na.rm |
standard ggplot function |
levelmax |
(integer or dataframe, default = 99) |
structure |
(dataframe: default =
. In the standard formula structure, SCR has level 1, with childlevel 2. This means it consists of all datalines with level == 2, ie. "BSCR", "operational" and "Adjustment-LACDT". lines in the dataset with a suffix "d" behind the levelnumber are diversification items. As of now these are not used in any calculation. the values in column "description" in the dataset need to match the description in this file. The package contains also a file |
maxscrvalue |
(optional, double, default = NULL) |
aggregatesuffix |
(string, default = "_other") |
scalingx |
(optional, positive value ,default = 1) |
scalingy |
(optional, positive value ,default = 1) |
rotationdegrees |
(optional, integer, -360 to 360, default = NULL) |
rotationdescription |
(optional, string, default = NULL) |
squared |
(optional, boolean, default = FALSE) |
plotdetails |
(optional) a table with columns 'levelordescription' and 'surface', indicating which circle elements to plot. When no table is provided all segments are plotted. example 3 shows how to combine geom_sii_risksurface and geom_sii_riskoutline by using using table |
... |
ellipsis, a standard R parameter |
Value
a ggplot object