Skip to content
Snippets Groups Projects
Commit 9fa87704 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

Correctly calculate net / Zillmer / alpha/beta/gamma premium components

I was wrongly using ifelse, which resulted in a single value that was repeated in the data.frame, rather than an if construct that would have returned a vector with a single non-null entry and 0 for all other entries.

Closes issue #68
parent f088d51b
No related branches found
No related tags found
No related merge requests found
_R_CHECK_DEPENDS_ONLY_=true
...@@ -1268,7 +1268,7 @@ InsuranceTarif = R6Class( ...@@ -1268,7 +1268,7 @@ InsuranceTarif = R6Class(
# Gross premium = net + zillmeredAlpha + unzillmeredAlpha + beta + gamma premium # Gross premium = net + zillmeredAlpha + unzillmeredAlpha + beta + gamma premium
unit.premiumCF = ifelse(premiums[["gross"]] == 0, premium.gross * 0, premium.gross / premiums[["gross"]]); unit.premiumCF = if (premiums[["gross"]] == 0) { premium.gross * 0 } else { premium.gross / premiums[["gross"]] }
if (values$absPresentValues[t, "premiums.unit"] == 0) { if (values$absPresentValues[t, "premiums.unit"] == 0) {
premium.gamma = 0 premium.gamma = 0
premium.beta = 0 premium.beta = 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment