Learn R Programming

Overview

This package implements the Swiss Solvency Test (SST) model.

1. Installation

Download either the source version (sstModel_X.Y.Z.tar.gz) or the binary version (sstModel_X.Y.Z.zip, Windows only) by clicking on the file you would like to download.

  1. Open RStudio and click on the Packages tab in the lower right window.
  2. Click on the Install button
  3. Select Install from: Package Archive File
  4. Click on the Browse button and find the archive file you just downloaded.
  5. Optionnally choose in which library you want to install the package.
  6. Click on the Install button and wait for the procedure to finish.
  7. Run this command in your R console: library(sstModel)
  8. Run this command in your R-console to check that everything is ok: sstModel_check().

2. Quick User guide

Note that an Excel template provided by FINMA should be used and that another Excel worksheet would cause the simulations to fail.

a. Command line

Execute an SST Simulation in the R console:

library(sstModel)
model <- excelToSstModel("path/to/excel/template.xlsm")
result <- compute(model, NUM_SIM)

Where path/to/excel/template.xlsm is the path to the Excel template on your computer and NUM_SIM is the desired number of simulations. Please note that very large number of simulations (> 1 000 000) will cause very long calculations.

Different solvency figures can be computed using the following methods.

marketValueMargin(result) # SST market value margin.
targetCapital(result, with.scenario = F) # SST target capital without scenario aggregation
targetCapital(result, with.scenario = T) # SST target capital with scenario aggregation
riskCapital(result, with.scenario = F) # SST one-year risk capital without scenario aggregation
riskCapital(result, with.scenario = T) # SST one-year risk capital with scenario aggregation
sstRatio(result, with.scenario = F) # SST ratio without scenario aggregation
sstRatio(result, with.scenario = T) # SST ratio with scenario aggregation

b. Graphical User Interface

Simply run the following command in your terminal:

sstModel::launchDashboard()

A graphical user interface will show up. You can then use the Interactive help button to discover the interface.

Copy Link

Version

Install

install.packages('sstModel')

Monthly Downloads

6

Version

1.0.0

License

GPL-3 + file LICENSE

Maintainer

Michael Schmutz

Last Published

May 3rd, 2018

Functions in sstModel (1.0.0)

compute.sstModel

Compute a sstModel
containsLife

Checks if the object contains a lifeRisk.
format.marketRisk

Formating a marketRisk
currencyIsIn.standalone

Currency in Standalone?
equityIsIn.standalone

Equity in Standalone?
delta

Constructing a Delta-Normal Remainder Term with Respect to MarketRisk
containsLife.sstOutput

containsLife Helper
format.lifeRisk

Formating a LifeRisk
excelToSstModel

Parsing an Excel Template to sstModel
compute.healthRisk

Compute a HealthRisk
compute.lifeRisk

Compute a LifeRisk
containsNonLife

Checks if the object contains nonLifeRisk.
generateError

Generate error message from an error log
containsScenario.sstOutput

containsScenario Helper
check.nonLifeRisk

Checking Consistency of a nonLifeRisk with a MarketRisk
equity

Constructing an Equity (Risk Factor)
containsScenario

Checks if the object contains scenario.
containsNonLife.sstOutput

containsNonLife Helper
check.scenarioRisk

Checking Consistency of a ScenarioRisk with a MarketRisk
generateExpression

Generate an Expression
check.life

Checking Consistency of a Life Delta-Normal Remainder Term with a MarketRisk and a HealthRisk
containsMarket

Checks if the object contains a MarketRisk.
compute.participationRisk

Compute a participationRisk
compute.nonLifeRisk

Compute a nonLifeRisk
getDeltaId.marketRisk

Get A Delta ID
getCurrencyScale

Get A Currency Scale
getCurrencyName.marketRisk

Get A Currency Name
computeConstant

Compute The Normalizing Constant for a log-Normal Random Variable
compute.macroEconomicScenarios

Computing Macro Economic Scenarios
containsHealth

Checks if the object contains a healthRisk.
containsHealth.sstOutput

containsHealth Helper
getDrbc

Get drbc
conditionalReordering

Conditional Reordering
containsParticipation

Checks if the object contains participation.
containsMarket.sstOutput

containsMarket Helper
containsParticipation.sstOutput

containsParticipation Helper
getInsuranceRisk.sstOutput

Get Insurance Risk
getInsuranceRisk

Get Insurance Risk
getLifeRisk

Get Life Risk
format.assetForward

Formating an Index-Forward
compute.marketRisk

Compute a MarketRisk
equityIsIn

Equity in Object?
containsInsurance

Checks if the object contains a insuranceRisk.
currency

Constructing a Currency (FX Exchange Rate Risk Factor)
getLifeRisk.sstOutput

Get Life Insurance Risk
getRateId.marketRisk

Get A Rate ID
currencyIsIn

Currency in Object?
getSpreadScale.marketRisk

Get A Spread Scale
format.cashflow

Formating a Fixed-Income-Asset
getRateId

Get A Rate ID
getSpreadScale

Get A Spread Scale
is.healthRisk

Assess Class Membership (healthRisk S3 class)
health

Constructing a Health Delta-Normal Term with Respect to healthRisk
healthRisk

Constructing a HealthRisk
format.nonLifeRisk

Formating a nonLifeRisk
format.participation

Formating a Participation
format.delta

Formating a Delta-Normal Remainder Term
format.summary.sstOutput

Formating a Summary of sstOutput
containsInsurance.sstOutput

containsInsurance Helper
creditRisk

Credit risk
format.fxForward

Formating an FX-Forward
format.participationRisk

Formating a ParticipationRisk
fxForward

Constructing an FX-Forward
creditRisk.sstOutput

Get Credit Risk from sstOutput
format.health

Formating a Health Delta-Normal Term
getCurrencyScale.marketRisk

Get A Currency Scale
is.insuranceItem

Assess Class Membership (insuranceItem S3 class)
itemListToFunction

Item List to Valuation Function Helper
itemListToExpression

Item List to Valuation Expression Helper
is.marketItem

Assess Class Membership (marketItem S3 class)
keywordToTransposedTable

Extract a table from the excel template
keywordToTable

Extract a table from the excel template
is.mappingTable

Assess Class Membership (mappingTable S3 class)
expectedShortfall

Compute the Expected Shortfall
mvmLife

MVM life computation
format.asset

Formating an Asset with Direct Market Price
na.rm

Remove Missing Values
format.portfolio

Formating a Portfolio
format.liability

Formating an Insurance Liability
format.sstOutput

Formating a sstOutput
format.healthRisk

Formating a HealhRisk
format.scenarioRisk

Formating a ScenarioRisk
print.healthRisk

Printing a HealthRisk
format.life

Formating a Life Delta-Normal Remainder Term
getEquityScale.marketRisk

Get An Equity Scale
getInitialRate.marketRisk

Get An Initial Rate
getHealthId

Get A Health Item ID
getMappingTime

Get A Time Mapping
getDeltaId

Get A Delta ID
getInitialSpread

Get An Initial Spread
format.sstModel

Formating a sstModel
getMappingTime.marketRisk

Get A Time Mapping
print.liability

Printing an Insurance Liability
getMarketRisk

Get Market Risk
format.standalone

Formating a standalone
getCurrencyName

Get A Currency Name
getCurrencyId.marketRisk

Get A Currency ID
generateFunction.portfolio

Generate the Market Valuation Function for a Portfolio
getMarketRisk.sstOutput

Get Market Risk
print.participation

Printing a Participation
getCurrencyId

Get A Currency ID
getEquityName.marketRisk

Get An Equity Name
getEquityScale

Get An Equity Scale
getInitialFX.marketRisk

Get An Initial FX
getScenarioRisk

Get Scenario Risk
print.participationRisk

Printing a participationRisk
print.standalone

Printing a standalone
getEquityId.marketRisk

Get An Equity ID
print.summary.portfolio

Printing a Summary of Portfolio
getEquityName

Get An Equity Name
scenarioRisk

Constructing a scenarioRisk
standaloneExpectedShortfall.sstOutput

Compute expected shortfall for standalone risk by reference
sstRatio.sstOutput

Compute the Swiss Solvency Test (SST) Ratio
sstRatio

Compute the Swiss Solvency Test (SST) Ratio
riskFactorToExpression

RiskFactor To Expression Helper
getScenarioRisk.sstOutput

Get Scenario Risk
is.cashflow

Assess Class Membership (cashflow S3 class)
getMarketParticipationRisk

Get Aggregated Market Risk and Participation
getInitialRate

Get An Initial Rate
format.summary.portfolio

Formating a Summary of Portfolio
getMarketParticipationRisk.sstOutput

Get Aggregated Market and Participation Risk
getParticipation

Get Participation
is.currency

Assess Class Membership (currency S3 class)
summary.asset

Summarizing an Asset with Direct Market Price
getParticipation.sstOutput

Get Participation
is.delta

Assess Class Membership (delta S3 class)
getSpreadName.marketRisk

Get A Spread Name
getSpreadName

Get A Spread Name
summary.sstOutput

Summarizing a sstOutput
getHealthQuantile

Get A Health Item Quantile
tableToAssetForward

Parsing a table to a list of assetForward
summary.standalone

Summarizing a standalone
tableToAssets

Parsing a table to a list of asset
is.equity

Assess Class Membership (equity S3 class)
getHealthRisk

Get Health Risk
is.marketRisk

Assess Class Membership (marketRisk S3 class)
generateExpression.portfolio

Generate the Market Valuation Expression for a Portfolio
format.summary.sstModel

Formating a Summary of sstModel
generateFunction

Generate a Function
getLifeId

Get A Life Item ID
is.item

Assess Class Membership (item S3 class)
getLifeId.lifeRisk

Get LifeRisk ID
initialFX

Constructing initial FX Rates
getRateName.marketRisk

Get A Rate Name
getRateName

Get A Rate Name
initialRate

Constructing Initial Interest Rates
is.insuranceRisk

Assess Class Membership (insuranceRisk S3 class)
getSpreadId.marketRisk

Get A Spread ID
is.nonLifeRisk

Assess Class Membership (nonLifeRisk S3 class)
getDrbc.sstOutput

Get drbc
valFunction

Valuation Function
getSpreadId

Get A Spread ID
is.pcRate

Assess Class Membership (pcRate S3 class)
is.portfolio

Assess Class Membership (portfolio S3 class)
initialSpread

Compute Initial Spread
valFunction.asset

Building the Valuation Function for Asset with Direct Market Price
lifeRisk

Constructing a LifeRisk
is.riskFactor

Assess Class Membership (riskFactor S3 class)
is.scenarioRisk

Assess Class Membership (scenerioRisk S3 class)
is.standalone

Assess Class Membership (standalone S3 class)
is.sstOutput

Assess Class Membership (sstOutput S3 class)
liability

Constructing an Insurance Liability
getInitialFX

Get An Initial FX
getHealthRisk.sstOutput

Get Health Insurance Risk
getEquityId

Get An Equity ID
logNormalExpression

Log-Normal Expression Helper
getLifeQuantile

Get A Life Item Quantile
intToGroups

Ordered Vector of Integers to List of consecutive integers
valInfo.cashflow

Providing Information for Fixed-Income-Asset Valuation from a marketRisk
valInfo.delta

Providing Information for Market Delta-Normal Remainder Term Valuation from a marketRisk
getLifeQuantile.lifeRisk

Get LifeRisk Quantiles
valueAtRisk

Compute the Value-at-Risk
life

Constructing a Life Delta-Normal Remainder Term with Respect to lifeRisk
getNonLifeRisk

Get nonLife Risk
newtonRaphson

Find roots using Newton-Raphson algorithm
participation

Constructing a Participation
volaToExpectedShortfall

Transform normal volatility in expected shortfall
participationRisk

Constructing a participationRisk
is.fxForward

Assess Class Membership (fxForward S3 class)
print.cashflow

Printing a Fixed-Income-Asset
print.delta

Printing a Delta-Normal Remainder Term
print.lifeRisk

Printing a LifeRisk
print.life

Printing a Life Delta-Normal Remainder Term
getNonLifeRisk.sstOutput

Get Non Life Insurance Risk
is.health

Assess Class Membership (health S3 class)
getRateScale

Get A Rate Scale
is.lifeRisk

Assess Class Membership (lifeRisk S3 class)
is.macroEconomicScenarios

Assess Class Membership (macroEconomicScenarios S3 class)
nonLifeRisk

Constructing a nonLifeRisk
pcRate

Constructing a Principal Component Rate (Risk Factor)
getRateScale.marketRisk

Get A Rate Scale
is.asset

Assess Class Membership (asset S3 class)
is.assetForward

Assess Class Membership (assetForward S3 class)
rate

Constructing a Rate (Risk Factor)
is.liability

Assess Class Membership (liability S3 class)
is.life

Assess Class Membership (life S3 class)
is.participationRisk

Assess Class Membership (standalone S3 class)
is.participation

Assess Class Membership (participation S3 class)
is.rate

Assess Class Membership (rate S3 class)
is.risk

Assess Class Membership (risk S3 class)
is.spread

Assess Class Membership (spread S3 class)
rateIsIn

Rate in Object?
portfolio

Constructing a SST Portfolio
simulate.healthRisk

Simulate from a HealthRisk
macroEconomicScenarios

Constructing Macro Economic Scenarios
mappingTable

Constructing a Mapping Table
simulate.lifeRisk

Simulate from a LifeRisk
is.sstModel

Assess Class Membership (sstModel S3 class)
marketRisk

Constructing a MarketRisk
mappingTime

Constructing Time Mappings
print.asset

Printing an Asset with Direct Market Price
print.assetForward

Printing an Index-Forward
sstModel_check

Run checks of the packages libraries to check for potential issues.
print.nonLifeRisk

Printing a nonLifeRisk
print.marketRisk

Printing a marketRisk
print.portfolio

Printing a Portfolio
launchDashboard

Launching The Dashboard In A Browser
keywordToValue

Extract a value from the excel template
marketValueMargin

Compute the Market Value Margin (MVM)
sstModel_news

Display sstModel R-package News File
summary.delta

Summarizing a Delta-Normal Remainder Term
print.scenarioRisk

Printing a ScenarioRisk
rateIsIn.standalone

Rate in standalone?
removePerfectCorr

Remove Perfectly Correlated Variables
summary.fxForward

Summarizing an FX-Forward
riskCapital

Compute the Risk Capital
summary.scenarioRisk

Summarizing a ScenarioRisk
marketValueMargin.sstOutput

Compute the Market Value Margin (MVM)
riskCapital.sstOutput

Compute the Risk Capital (RC)
splitComma

Split Characters
simulate.marketRisk

Simulate from a MarketRisk
spread

Constructing a Spread (Risk Factor)
summary.sstModel

Summarizing an sstModel
sstModel-package

Implementation of the Swiss Solvency Test (SST) Standard Models.
sstModel

Constructing an sstModel
summary.assetForward

Summarizing an Index-Forward
simulate.nonLifeRisk

Simulate from a nonLifeRisk
targetCapital.sstOutput

Compute the Target Capital (TC)
spreadIsIn

Spread in Object?
summary.cashflow

Summarizing a Fixed-Income-Asset
translate

translate
summary.lifeRisk

Summarizing a LifeRisk
summary.marketRisk

Summarizing a marketRisk
print.health

Printing a Health Delta-Normal Term
print.fxForward

Printing an FX-Forward
print.sstModel

Printing a sstModel
valExpression.asset

Building the Valuation Expression for Asset with Direct Market Price
tableToCashflow

Parsing a table to a list of cashflow
valExpression.assetForward

Building the Valuation Expression for an Index-Forward
spreadIsIn.standalone

Spread in Standalone?
print.sstOutput

Printing a sstOutput
print.summary.sstModel

Printing a Summary of sstModel
simulate.participationRisk

Simulate from a participationRisk
print.summary.sstOutput

Printing a Summary of sstOutput
simulate.scenarioRisk

Simulate from a ScenarioRisk
tableToFxForward

Parsing a table to a list of fxForward
valFunction.liability

Building the Valuation Function for an Insurance Liability Valuation
valExpression.fxForward

Building the Valuation Expression for a FX-Forward Position
standalone

Constructing a Standalone Market Risk
valInfo

Providing Valuation Information
valExpression.health

Building the Valuation Expression for a Health Item
standaloneExpectedShortfall

Compute expected shortfall for standalone risk by reference
valFunction.assetForward

Building the Valuation Function for an Index-Forward
summary.liability

Summarizing an Insurance Liability
valFunction.cashflow

Building the Valuation Function for a Fixed-Income-Asset
summary.life

Summarizing a Life Delta-Normal Remainder Term
summary.nonLifeRisk

Summarizing a nonLifeRisk
summary.participation

Summarizing a Participation
valInfo.fxForward

Providing Information for FX-Forward Valuation from a marketRisk
valInfo.health

Providing Information for Health Item Valuation from a marketRisk and a healthRisk
summary.health

Summarizing a Health Delta-Normal Term
summary.healthRisk

Summarizing a HealthRisk
summary.participationRisk

Summarizing a participationRisk
valExpression.cashflow

Building the Valuation Expression for a Fixed-Income-Asset
tableToLiability

Parsing a table to a list of liability
summary.portfolio

Summarizing a Portfolio
targetCapital

Target Capital
translate.sstOutput

Translation of Fields of sstOutput
valExpression

Valuation Expression
valExpression.delta

Building the Valuation Expression for a Market Delta-Normal Remainder Term
valInfo.assetForward

Providing Information for Index-Forward Valuation from a marketRisk
valExpression.liability

Building the Valuation Expression for an Insurance Liability
valInfo.asset

Providing Valuation Information for Asset with Direct Market Price
write.sstOutput

Writing a sstOutput into a fundamental data sheet
valExpression.life

Building the Valuation Expression for a Life Item
valFunction.delta

Building the Valuation Function for a Market Delta-Normal Remainder Term
valFunction.fxForward

Building the Valuation Function for a FX-Forward
valInfo.liability

Providing Information for Insurance Liability Valuation from a marketRisk
valInfo.life

Providing Information for Life Item Valuation from a marketRisk and a lifeRisk
changeBaseCurrency

Change Covariance Matrix According to Change of Base Currency
check

Object Checks
check.asset

Checking Consistency of an Asset with Direct Market Price with a MarketRisk
assetForward

Constructing an Index-Forward
asset

Constructing an Asset with Direct Market Price
check.delta

Checking Consistency of a Delta-Normal Remainder Term with a MarketRisk
aggregateRisks

Risk Aggregation Helper
cashflow

Constructing a Fixed-Income-Asset
check.assetForward

Checking Consistency of an Index-Forward with a MarketRisk
check.liability

Checking Consistency of an Insurance Liability with a MarketRisk
check.participation

Checking Consistency of a Participation with a MarketRisk
check.macroEconomicScenarios

Checking Macro Economic Scenarios
check.standalone

Checking Consistency of a Standalone with a MarketRisk
compute

Object Computations
check.cashflow

Checking Consistency of a Fixed-Income-Asset with a MarketRisk
check.fxForward

Checking Consistency of a FX-Forward with a MarketRisk
compute.scenarioRisk

Compute a ScenarioRisk
check.health

Checking Consistency of a Health Delta-Normal Term with a MarketRisk and a HealthRisk