Title: | A 'ggplot2'-Plot of Composition of Solvency II SCR: SF and IM |
---|---|
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). |
Authors: | Marco van Zanden [aut, cre] |
Maintainer: | Marco van Zanden <[email protected]> |
License: | GPL-3 |
Version: | 0.2.0.1 |
Built: | 2024-11-09 04:09:00 UTC |
Source: | https://github.com/vanzanden/ggsolvencyii |
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.
geom_sii_riskconnection(data = NULL, mapping = NULL, stat = "sii_riskconnection", position = "identity", na.rm = FALSE, show.legend = NA, inherit.aes = TRUE, ...)
geom_sii_riskconnection(data = NULL, mapping = NULL, stat = "sii_riskconnection", position = "identity", na.rm = FALSE, show.legend = NA, inherit.aes = TRUE, ...)
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 |
a 'ggplot2' object based on 'geom_polygon'
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() )
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() )
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.
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, ...)
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, ...)
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 |
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.
a 'ggplot2' object geom_sii_risksurface
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 )
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 )
returns a 'ggplot2' object, based on geom_polygon, with filled, concentric circle(part)s, defined by the values in a hierarchy of levels.
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, ...)
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, ...)
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 |
a ggplot object
## 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)
## 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)
get_external_data makes a call to website vanzanden.nl. The only purpose is to track the usage of (parts) of the package.
get_external_data(caller = "stat_usage.csv")
get_external_data(caller = "stat_usage.csv")
caller |
(default = "stat_usage.csv") the filename which will be downloaded, for each geom is a separate file available |
it returns a list: $success = TRUE/FALSE
library(ggsolvencyii) callresult <- ggsolvencyii:::get_external_data(caller = "stat_usage.csv") callresult
library(ggsolvencyii) callresult <- ggsolvencyii:::get_external_data(caller = "stat_usage.csv") callresult
assists in finding level or description mismatches in a set parameter(tables)
sii_debug_geom(data_descriptionvector, structure = ggsolvencyii::sii_structure_sf16_eng, aggregatesuffix = "other", levelmax = NULL, plotdetails = NULL, fillcolors = NULL, edgecolors = NULL)
sii_debug_geom(data_descriptionvector, structure = ggsolvencyii::sii_structure_sf16_eng, aggregatesuffix = "other", levelmax = NULL, plotdetails = NULL, fillcolors = NULL, edgecolors = NULL)
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 ) |
prints two comparison tables and puts them in $debug_description and $debug_level
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.
sii_levelmax_sf16_993
sii_levelmax_sf16_993
A data frame with columns:
string with format 'level(numeric)' [<point> 'sublevel(numeric)'] ['d'] i.e. 1, 2.01, 3.1d where d indicates a diversification component
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
made from excel-file in github.com/vanzanden :
installedtable <- sii_levelmax_sf16_993 installedtable
installedtable <- sii_levelmax_sf16_993 installedtable
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.
sii_levelmax_sf16_995
sii_levelmax_sf16_995
A data frame with columns:
string with format 'level(numeric)' [<point> 'sublevel(numeric)'] ['d'] i.e. 1, 2.01, 3.1d where d indicates a diversification component
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
made from excel-file in github.com/vanzanden, from there transfered to R environment with code in preparingtables.R
.
installedtable <- sii_levelmax_sf16_995 installedtable
installedtable <- sii_levelmax_sf16_995 installedtable
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.
sii_plotdetails_sf16
sii_plotdetails_sf16
A data frame with columns:
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
boolean (logical): the surface
boolean (logical): the radial line
boolean (logical): the outer line
boolean (logical): the radial line
boolean (logical): the inner line
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
NOT YET IMPLEMENTED: boolean (logical): analogue to outline3, but but only for the last plotted component of that level.
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
.
installedtable <- sii_plotdetails_sf16 installedtable
installedtable <- sii_plotdetails_sf16 installedtable
sii_setoption_statistics_httpfailurecounter
sii_setoption_statistics_httpfailurecounter(cnt = 0)
sii_setoption_statistics_httpfailurecounter(cnt = 0)
cnt |
(default = 0) the value to be assigned to the counter |
nothing
# library(ggsolvencyii) ggsolvencyii:::sii_setoption_statistics_httpfailurecounter() ggsolvencyii:::sii_setoption_statistics_httpfailurecounter(cnt = 10)
# library(ggsolvencyii) ggsolvencyii:::sii_setoption_statistics_httpfailurecounter() ggsolvencyii:::sii_setoption_statistics_httpfailurecounter(cnt = 10)
sii_setoption_statistics_participate sets the option to participate in anonymous user statistics, no other data is sent other than the calling geom and the IP adress
sii_setoption_statistics_participate(participate = TRUE, quiet = FALSE)
sii_setoption_statistics_participate(participate = TRUE, quiet = FALSE)
participate |
(boolean, default = TRUE) whether to participate |
quiet |
(boolean, default = FALSE) whether to confirm that the option is set |
participate
library(ggsolvencyii) sii_setoption_statistics_participate() sii_setoption_statistics_participate(FALSE) sii_setoption_statistics_participate(participate = FALSE, quiet = FALSE)
library(ggsolvencyii) sii_setoption_statistics_participate() sii_setoption_statistics_participate(FALSE) sii_setoption_statistics_participate(participate = FALSE, quiet = FALSE)
sii_setoption_statistics_remind sets the option to remind that participation is set to TRUE (if that is the case) after 1,2,3,5,10,50,100,200,500,1000,1500,2500 calls
sii_setoption_statistics_remind(remind = TRUE, quiet = FALSE)
sii_setoption_statistics_remind(remind = TRUE, quiet = FALSE)
remind |
(default = TRUE) : whether to remind that participation is set |
quiet |
(default = FALSE) : whether to confirm that the option is set |
remind
library(ggsolvencyii) sii_setoption_statistics_remind() sii_setoption_statistics_remind(remind = FALSE) sii_setoption_statistics_remind(remind = FALSE, quiet = TRUE)
library(ggsolvencyii) sii_setoption_statistics_remind() sii_setoption_statistics_remind(remind = FALSE) sii_setoption_statistics_remind(remind = FALSE, quiet = TRUE)
sii_setoption_statistics_remindercounter
sii_setoption_statistics_remindercounter(cnt = 0)
sii_setoption_statistics_remindercounter(cnt = 0)
cnt |
(default = 0) |
nothing
# library(ggsolvencyii) ggsolvencyii:::sii_setoption_statistics_remindercounter() ggsolvencyii:::sii_setoption_statistics_remindercounter(cnt = 10)
# library(ggsolvencyii) ggsolvencyii:::sii_setoption_statistics_remindercounter() ggsolvencyii:::sii_setoption_statistics_remindercounter(cnt = 10)
a standard formula structure (as of 2016), with descriptions in English.
sii_structure_sf16_eng
sii_structure_sf16_eng
A data frame with columns:
string: the name of the component
string with format 'level(numeric)' [<point> 'sublevel(numeric)'] ['d'] i.e. 1, 2.01, 3.1d where d indicates a diversification component
string, same format as level, indicating the level of which the components combine into this level
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
.
installedtable <- sii_structure_sf16_eng installedtable
installedtable <- sii_structure_sf16_eng installedtable
a standard formula structure (as of 2016), with descriptions in Dutch.
sii_structure_sf16_nld
sii_structure_sf16_nld
A data frame with columns:
string: the name of the component
string with format 'level(numeric)' [<point> 'sublevel(numeric)'] ['d'] i.e. 1, 2.01, 3.1d where d indicates a diversification component
string, same format as level, indicating the level of which the components combine into this level
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
.
installedtable <- sii_structure_sf16_nld installedtable
installedtable <- sii_structure_sf16_nld installedtable
a colorset, as named list, where each risk has the edgecolor of the "motherlevel", as defined in the ..fillcolors..
variable.
sii_x_edgecolors_sf16_eng
sii_x_edgecolors_sf16_eng
A list with items in the form "description"= "#colorcode":
made with preparingtables.R
(not included in this package) which can be found on github.com/vanzanden/ggsolvencyii
installedtable <- sii_x_edgecolors_sf16_eng installedtable
installedtable <- sii_x_edgecolors_sf16_eng installedtable
a colorset, as named list, where each risk has the edgecolor of the "motherlevel", as defined in the ..fillcolors..
variable.
sii_x_edgecolors_sf16_nld
sii_x_edgecolors_sf16_nld
A list with items in the form "description"= "#colorcode":
made with preparingtables.R
(not included in this package) which can be found on github.com/vanzanden/ggsolvencyii
installedtable <- sii_x_edgecolors_sf16_nld installedtable
installedtable <- sii_x_edgecolors_sf16_nld installedtable
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.
sii_x_fillcolors_sf16_eng
sii_x_fillcolors_sf16_eng
A list with items in the form "description"= "#colorcode":
made with preparingtables.R
(not included in this package) which can be found on github.com/vanzanden/ggsolvencyii
installedtable <- sii_x_fillcolors_sf16_eng installedtable
installedtable <- sii_x_fillcolors_sf16_eng installedtable
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.
sii_x_fillcolors_sf16_nld
sii_x_fillcolors_sf16_nld
A list with items in the form "description"= "#colorcode":
made with preparingtables.R
(not included in this package) which can be found on github.com/vanzanden/ggsolvencyii
installedtable <- sii_x_fillcolors_sf16_nld installedtable
installedtable <- sii_x_fillcolors_sf16_nld installedtable
example dataset, in tidyverse format, for the showcase of a limited structure.
sii_z_ex1_data
sii_z_ex1_data
A data frame with columns:
numerical: a representation of an x value:
The x aesthetic could also be a normal numbering, or a longitude
numerical: solvency II ratio, a representation of an y value:
y aesthetic could also be a lattitude
character: component of the structure
number: a grouping item
numerical: positive for risks, negative for diversification effects
numerical: a reference to the id of another datapoint
#'
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
.
installedtable <- sii_z_ex1_data installedtable
installedtable <- sii_z_ex1_data installedtable
a colorset, as named list, where each risk has the edgecolor of the "motherlevel", as defined in the ..fillcolors..
variable.
sii_z_ex1_edgecolors
sii_z_ex1_edgecolors
A list with items in the form "description"= "#colorcode":
made with preparingtables.R
(not included in this package) which can be found on github.com/vanzanden/ggsolvencyii
installedtable <- sii_z_ex1_edgecolors installedtable
installedtable <- sii_z_ex1_edgecolors installedtable
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.
sii_z_ex1_fillcolors
sii_z_ex1_fillcolors
A list with items in the form "description"= "#colorcode":
made with preparingtables.R
(not included in this package) which can be found on github.com/vanzanden/ggsolvencyii
installedtable <- sii_z_ex1_fillcolors installedtable
installedtable <- sii_z_ex1_fillcolors installedtable
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/...)
sii_z_ex1_levelmax
sii_z_ex1_levelmax
A data frame with columns:
made from excel-file in github.com/vanzanden, from there transfered to R environment with code in preparingtables.R
.
installedtable <- sii_z_ex1_levelmax installedtable
installedtable <- sii_z_ex1_levelmax installedtable
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. 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.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.
sii_z_ex1_plotdetails
sii_z_ex1_plotdetails
A data frame with columns:
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
boolean (logical): the surface
boolean (logical): the radial line
boolean (logical): the outer line
boolean (logical): the radial line
boolean (logical): the inner line
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
NOT YET IMPLEMENTED: boolean (logical): analogue to outline3, but but only for the last plotted component of that level.
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
.
installedtable <- sii_z_ex1_plotdetails installedtable
installedtable <- sii_z_ex1_plotdetails installedtable
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. 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.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.
sii_z_ex1_plotdetails2
sii_z_ex1_plotdetails2
A data frame with columns:
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
boolean (logical): the surface
boolean (logical): the radial line
boolean (logical): the outer line
boolean (logical): the radial line
boolean (logical): the inner line
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
NOT YET IMPLEMENTED: boolean (logical): analogue to outline3, but but only for the last plotted component of that level.
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
.
installedtable <- sii_z_ex1_plotdetails2 installedtable
installedtable <- sii_z_ex1_plotdetails2 installedtable
a adapted (compact) structure, for a life-insurer with only market and life risk and their subrisks
sii_z_ex1_structure
sii_z_ex1_structure
A data frame with columns:
string: the name of the component, or a diversification
string with format 'level(numeric)' [<point> 'sublevel(numeric)'] ['d'] i.e. 1, 2.01, 3.1d where d indicates a diversification component
string of the same format as level, indicating the level of which the components make up this item
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
.
installedtable <- sii_z_ex1_structure installedtable
installedtable <- sii_z_ex1_structure installedtable
example dataset, in tidyverse format, with only one instance of a limited filled sf structure.
sii_z_ex2_data
sii_z_ex2_data
A data frame with columns:
numerical: a representation of an x value:
The x aesthetic could also be a normal numbering, or a longitude
numerical: solvency II ratio, a representation of an y value:
y aesthetic could also be a lattitude
character: component of the structure
number: a grouping item
numerical: positive for risks, negative for diversification effects
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
.
installedtable <- sii_z_ex2_data installedtable
installedtable <- sii_z_ex2_data installedtable
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,
sii_z_ex3_data
sii_z_ex3_data
A data frame with columns:
numerical: a representation of an x value:
The x aesthetic could also be a normal numbering, or a longitude
numerical: solvency II ratio, a representation of an y value:
y aesthetic could also be a lattitude
character: component of the structure
number: a grouping item
numerical: positive for risks, negative for diversification effects
numerical: a reference to the id of another datapoint
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
.
installedtable <- sii_z_ex3_data installedtable
installedtable <- sii_z_ex3_data installedtable
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. 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.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.
sii_z_ex3_plotdetails
sii_z_ex3_plotdetails
A data frame with columns:
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
boolean (logical): the surface
boolean (logical): the radial line
boolean (logical): the outer line
boolean (logical): the radial line
boolean (logical): the inner line
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
NOT YET IMPLEMENTED: boolean (logical): analogue to outline3, but but only for the last plotted component of that level.
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
.
installedtable <- sii_z_ex3_plotdetails installedtable
installedtable <- sii_z_ex3_plotdetails installedtable
example dataset, in tidyverse format, with several instances of a filled sf structure,
sii_z_ex4_data
sii_z_ex4_data
A data frame with columns:
numerical: a representation of an x value:
The x aesthetic could also be a normal numbering, or a longitude
numerical: solvency II ratio, a representation of an y value:
y aesthetic could also be a lattitude
character: component of the structure
number: a grouping item
numerical: positive for risks, negative for diversification effects
numerical: a reference to the id of another datapoint
#'
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
.
installedtable <- sii_z_ex4_data installedtable
installedtable <- sii_z_ex4_data installedtable
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/...)
sii_z_ex4_levelmax
sii_z_ex4_levelmax
A data frame with columns:
made from excel-file in github.com/vanzanden, from there transfered to R environment with code in preparingtables.R
.
installedtable <- sii_z_ex4_levelmax installedtable
installedtable <- sii_z_ex4_levelmax installedtable
a adapted (compact) structure with no division of market, life, .. risks in subrisks (i.e. equity, longevity,... ). Descriptions are in English
sii_z_ex4_structure
sii_z_ex4_structure
A data frame with columns:
string: the name of the component, or a diversification
string with format 'level(numeric)' [<point> 'sublevel(numeric)'] ['d'] i.e. 1, 2.01, 3.1d where d indicates a diversification component
string of the same format as level, indicating the level of which the components make up this item
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
.
installedtable <- sii_z_ex4_structure installedtable
installedtable <- sii_z_ex4_structure installedtable
example dataset of a internal model of a large Dutch insurer (NN group). Values are fictious
sii_z_ex6_data
sii_z_ex6_data
A data frame with columns:
numerical: a representation of an x value:
The x aesthetic could also be a normal numbering, or a longitude
numerical: solvency II ratio, a representation of an y value:
y aesthetic could also be a lattitude
character: component of the structure
number: a grouping item
numerical: positive for risks, negative for diversification effects
numerical: a reference to the id of another datapoint
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.
installedtable <- sii_z_ex6_data installedtable
installedtable <- sii_z_ex6_data installedtable
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
sii_z_ex6_data2
sii_z_ex6_data2
A data frame with columns:
numerical: a representation of an x value:
The x aesthetic could also be a normal numbering, or a longitude
numerical: solvency II ratio, a representation of an y value:
y aesthetic could also be a lattitude
character: component of the structure
number: a grouping item
numerical: positive for risks, negative for diversification effects
numerical: a reference to the id of another datapoint
#'
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.
installedtable <- sii_z_ex6_data2 installedtable
installedtable <- sii_z_ex6_data2 installedtable
a colorset, as named list, where each risk has the edgecolor of the "motherlevel", as defined in the ..fillcolors..
variable.
sii_z_ex6_edgecolors
sii_z_ex6_edgecolors
A list with items in the form "description"= "#colorcode":
made with preparingtables.R
(not included in this package) which can be found on github.com/vanzanden/ggsolvencyii
installedtable <- sii_z_ex6_edgecolors installedtable
installedtable <- sii_z_ex6_edgecolors installedtable
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.
sii_z_ex6_fillcolors
sii_z_ex6_fillcolors
A list with items in the form "description"= "#colorcode":
made with preparingtables.R
(not included in this package) which can be found on github.com/vanzanden/ggsolvencyii
installedtable <- sii_z_ex6_fillcolors installedtable
installedtable <- sii_z_ex6_fillcolors installedtable
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/...)
sii_z_ex6_levelmax
sii_z_ex6_levelmax
A data frame with columns:
made from excel-file in github.com/vanzanden, from there transfered to R environment with code in preparingtables.R
.
installedtable <- sii_z_ex6_levelmax installedtable
installedtable <- sii_z_ex6_levelmax installedtable
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. 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.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.
sii_z_ex6_plotdetails
sii_z_ex6_plotdetails
A data frame with columns:
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
boolean (logical): the surface
boolean (logical): the radial line
boolean (logical): the outer line
boolean (logical): the radial line
boolean (logical): the inner line
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
NOT YET IMPLEMENTED: boolean (logical): analogue to outline3, but but only for the last plotted component of that level.
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
.
installedtable <- sii_z_ex6_plotdetails installedtable
installedtable <- sii_z_ex6_plotdetails installedtable
a standard formula structure (as of 2016), with descriptions in English.
sii_z_ex6_structure
sii_z_ex6_structure
A data frame with columns:
string: the name of the component
string with format 'level(numeric)' [<point> 'sublevel(numeric)'] ['d'] i.e. 1, 2.01, 3.1d where d indicates a diversification component
string, same format as level, indicating the level of which the components combine into this level
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
.
installedtable <- sii_z_ex6_structure installedtable
installedtable <- sii_z_ex6_structure installedtable
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,
sii_z_ex7_data
sii_z_ex7_data
A data frame with columns:
numerical: a representation of an x value:
The x aesthetic could also be a normal numbering, or a longitude
numerical: solvency II ratio, a representation of an y value:
y aesthetic could also be a lattitude
character: component of the structure
number: a grouping item
numerical: positive for risks, negative for diversification effects
numerical: a reference to the id of another datapoint
#'
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
.
installedtable <- sii_z_ex7_data installedtable
installedtable <- sii_z_ex7_data installedtable
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. 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.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.
sii_z_ex7_plotdetails
sii_z_ex7_plotdetails
A data frame with columns:
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
boolean (logical): the surface
boolean (logical): the radial line
boolean (logical): the outer line
boolean (logical): the radial line
boolean (logical): the inner line
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
NOT YET IMPLEMENTED: boolean (logical): analogue to outline3, but but only for the last plotted component of that level.
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
.
installedtable <- sii_z_ex7_plotdetails installedtable
installedtable <- sii_z_ex7_plotdetails installedtable
returns a 'ggplot2' object with filled, concentric circle(part)s, defined by the values of a hierarchy of levels.
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, ...)
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, ...)
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 |
a ggplot object
This behaviour can be switched off by means of calling " " When switche on a reminder is given in regular intervals. This behaviour can also be switched off by calling " "
statistics(caller = "stat_usage.csv")
statistics(caller = "stat_usage.csv")
caller |
(default = "stat_usage.csv") the filename which will be downloaded, for each geom is a separate file available |
nothing
# library(ggsolvencyii) ggsolvencyii:::statistics() sii_setoption_statistics_httpfailurecounter <- function(cnt = 52) ggsolvencyii:::statistics(caller = "404notfound.csv") sii_setoption_statistics_httpfailurecounter <- function(cnt = 0) sii_setoption_statistics_participate(participate = TRUE)
# library(ggsolvencyii) ggsolvencyii:::statistics() sii_setoption_statistics_httpfailurecounter <- function(cnt = 52) ggsolvencyii:::statistics(caller = "404notfound.csv") sii_setoption_statistics_httpfailurecounter <- function(cnt = 0) sii_setoption_statistics_participate(participate = TRUE)