lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 797084e 2/4: Replace initial with maximum loa


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 797084e 2/4: Replace initial with maximum loan due rate in ledger
Date: Mon, 4 Feb 2019 20:12:05 -0500 (EST)

branch: master
commit 797084e38ea1f440fc1b0e7e81984c04bdb0ceba
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Replace initial with maximum loan due rate in ledger
    
    Reports use this value only in contexts where a scalar is portrayed as
    representing a vector whose elements actually may vary from year to
    year--a purpose for which the maximum is better suited because this
    portrayal is in the nature of a guarantee.
    
    The corresponding spread is already "guaranteed not to exceed" a given
    (defectively hardcoded) value as depicted in 'ill_reg_narr_summary.mst'.
    Both the gross rate and the spread may vary by year; if, for brevity,
    the year-by-year values aren't to be shown, then the (scalar) maximum
    should be used for both, and composites should use the maximum value
    across all cells.
---
 ill_reg_narr_summary2.mst | 8 +++++++-
 ledger_evaluator.cpp      | 2 +-
 ledger_invariant.cpp      | 4 ++--
 ledger_invariant.hpp      | 2 +-
 ledger_invariant_init.cpp | 8 ++++++--
 reg_d_indiv_notes1.mst    | 8 +++++++-
 6 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/ill_reg_narr_summary2.mst b/ill_reg_narr_summary2.mst
index 60276f1..c41ebb9 100644
--- a/ill_reg_narr_summary2.mst
+++ b/ill_reg_narr_summary2.mst
@@ -64,8 +64,14 @@
 This illustration assumes death of the insured at age {{EndtAge}}.
 </p>
 
+{{!
+    PDF !! 'MaxAnnLoanDueRate': loan rate actually can vary by year,
+    so text should say that the fixed loan rate is "guaranteed never
+    to exceed" this value.
+}}
+
 <p>
-The loan interest rate is fixed at {{InitAnnLoanDueRate}} per year.
+The loan interest rate is fixed at {{MaxAnnLoanDueRate}} per year.
 </p>
 
 <p>
diff --git a/ledger_evaluator.cpp b/ledger_evaluator.cpp
index d720a79..24f984f 100644
--- a/ledger_evaluator.cpp
+++ b/ledger_evaluator.cpp
@@ -444,7 +444,6 @@ format_map_t static_formats()
     {{"GuarMaxMandE"                    , f4}
     ,{"InitAnnGenAcctInt"               , f4}
     ,{"InitAnnLoanCredRate"             , f4}
-    ,{"InitAnnLoanDueRate"              , f4}
     ,{"InitAnnSepAcctCurrGross0Rate"    , f4}
     ,{"InitAnnSepAcctCurrGrossHalfRate" , f4}
     ,{"InitAnnSepAcctCurrNet0Rate"      , f4}
@@ -455,6 +454,7 @@ format_map_t static_formats()
     ,{"InitAnnSepAcctGuarNet0Rate"      , f4}
     ,{"InitAnnSepAcctGuarNetHalfRate"   , f4}
     ,{"InitAnnSepAcctNetInt"            , f4}
+    ,{"MaxAnnLoanDueRate"               , f4}
     ,{"PostHoneymoonSpread"             , f4}
     ,{"Preferred"                       , f4}
     ,{"PremTaxRate"                     , f4}
diff --git a/ledger_invariant.cpp b/ledger_invariant.cpp
index a6fecde..66bc595 100644
--- a/ledger_invariant.cpp
+++ b/ledger_invariant.cpp
@@ -163,7 +163,7 @@ void LedgerInvariant::Alloc(int len)
     OtherScalars    ["PostHoneymoonSpread"   ] = &PostHoneymoonSpread    ;
     OtherScalars    ["SplitMinPrem"          ] = &SplitMinPrem           ;
     OtherScalars    ["ErNotionallyPaysTerm"  ] = &ErNotionallyPaysTerm   ;
-    OtherScalars    ["InitAnnLoanDueRate"    ] = &InitAnnLoanDueRate     ;
+    OtherScalars    ["MaxAnnLoanDueRate"     ] = &MaxAnnLoanDueRate      ;
     OtherScalars    ["IsInforce"             ] = &IsInforce              ;
     OtherScalars    ["CurrentCoiMultiplier"  ] = &CurrentCoiMultiplier   ;
     OtherScalars    ["NoLapseAlwaysActive"   ] = &NoLapseAlwaysActive    ;
@@ -730,7 +730,7 @@ LedgerInvariant& LedgerInvariant::PlusEq(LedgerInvariant 
const& a_Addend)
 
     ErNotionallyPaysTerm = ErNotionallyPaysTerm || 
a_Addend.ErNotionallyPaysTerm;
 
-    InitAnnLoanDueRate = a_Addend.InitAnnLoanDueRate;
+    MaxAnnLoanDueRate  = std::max(a_Addend.MaxAnnLoanDueRate, 
MaxAnnLoanDueRate);
 
     NoLapseMinDur      = std::min(a_Addend.NoLapseMinDur, NoLapseMinDur);
     NoLapseMinAge      = std::min(a_Addend.NoLapseMinAge, NoLapseMinAge);
diff --git a/ledger_invariant.hpp b/ledger_invariant.hpp
index c0d9dfa..18a18ab 100644
--- a/ledger_invariant.hpp
+++ b/ledger_invariant.hpp
@@ -188,7 +188,7 @@ class LMI_SO LedgerInvariant
     double          PostHoneymoonSpread;
     double          SplitMinPrem;
     double          ErNotionallyPaysTerm;
-    double          InitAnnLoanDueRate;
+    double          MaxAnnLoanDueRate;
     double          IsInforce;
     double          CurrentCoiMultiplier;
     double          NoLapseAlwaysActive;
diff --git a/ledger_invariant_init.cpp b/ledger_invariant_init.cpp
index 8bc2d24..8ca2271 100644
--- a/ledger_invariant_init.cpp
+++ b/ledger_invariant_init.cpp
@@ -41,7 +41,7 @@
 #include "product_data.hpp"
 #include "ssize_lmi.hpp"
 
-#include <algorithm>                    // max()
+#include <algorithm>                    // max(), max_element()
 #include <stdexcept>
 
 void LedgerInvariant::Init(BasicValues const* b)
@@ -125,7 +125,11 @@ void LedgerInvariant::Init(BasicValues const* b)
         (mce_gen_curr
         ,mce_annual_rate
         );
-    InitAnnLoanDueRate   = AnnLoanDueRate[0];
+    LMI_ASSERT(!AnnLoanDueRate.empty()); // Ensure std::max_element() works.
+    MaxAnnLoanDueRate    = *std::max_element
+        (AnnLoanDueRate.begin()
+        ,AnnLoanDueRate.end()
+        );
     CurrMandE            = b->InterestRates_->MAndERate(mce_gen_curr);
     TotalIMF             = b->InterestRates_->InvestmentManagementFee();
     RefundableSalesLoad  = b->Loads_->refundable_sales_load_proportion();
diff --git a/reg_d_indiv_notes1.mst b/reg_d_indiv_notes1.mst
index 8752bfa..8d98052 100644
--- a/reg_d_indiv_notes1.mst
+++ b/reg_d_indiv_notes1.mst
@@ -157,12 +157,18 @@ money manager (if any).
 <font size="+1"><b><u>Withdrawals and Policy Loans</u></b></font>
 </p>
 
+{{!
+    PDF !! 'MaxAnnLoanDueRate': loan rate actually can vary by year,
+    so text should say that the fixed loan rate is "guaranteed never
+    to exceed" this value.
+}}
+
 <p>
 If applicable, withdrawals and policy loans will appear on a
 supplemental report at the end of the illustration. Withdrawals
 and policy loans are assumed to be taken at the beginning of the
 applicable policy year. The illustration and supplemental report
-reflect a fixed policy loan interest rate of {{InitAnnLoanDueRate}}.
+reflect a fixed policy loan interest rate of {{MaxAnnLoanDueRate}}.
 </p>
 
 <p>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]