lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master ffa6b3b 4/4: Fix defect introduced 20080125T1


From: Greg Chicares
Subject: [lmi-commits] [lmi] master ffa6b3b 4/4: Fix defect introduced 20080125T1653: failure to use product database
Date: Mon, 4 Feb 2019 20:12:05 -0500 (EST)

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

    Fix defect introduced 20080125T1653: failure to use product database
    
    Added loan spread to ledger; used it to fix this defect. Generally-
    incorrect loan-spread values that vary by product had been hard-coded in
    public XSL files, whereas the correct values available in proprietary
    product files should obviously have been used instead.
    
    Incidentally, renamed the ledger's loan due rate:
    -MaxAnnLoanDueRate
    +MaxAnnGuarLoanSpread
    +MaxAnnCurrLoanDueRate
    to emphasize that it is current while the ledger's spread is guaranteed.
---
 ill_reg_narr_summary.mst  |  8 +-------
 ill_reg_narr_summary2.mst |  4 ++--
 interest_rates.hpp        | 10 ++++++++++
 ledger_evaluator.cpp      |  3 ++-
 ledger_invariant.cpp      |  6 ++++--
 ledger_invariant.hpp      |  3 ++-
 ledger_invariant_init.cpp | 10 ++++++++--
 reg_d_indiv_notes1.mst    |  4 ++--
 8 files changed, 31 insertions(+), 17 deletions(-)

diff --git a/ill_reg_narr_summary.mst b/ill_reg_narr_summary.mst
index 536cda8..dff0634 100644
--- a/ill_reg_narr_summary.mst
+++ b/ill_reg_narr_summary.mst
@@ -110,13 +110,7 @@ overhead expenses is the fully allocated expense method.
 <p>
 Loaned amounts of the {{AvName}}
 Value will be credited a rate equal to the loan interest rate less
-a spread, guaranteed not to exceed
-{{#GroupCarveout}}
-1.25%.
-{{/GroupCarveout}}
-{{^GroupCarveout}}
-3.00%.
-{{/GroupCarveout}}
+a spread, guaranteed not to exceed {{MaxAnnGuarLoanSpread}}.
 </p>
 
 {{#HasTerm}}
diff --git a/ill_reg_narr_summary2.mst b/ill_reg_narr_summary2.mst
index c41ebb9..546a808 100644
--- a/ill_reg_narr_summary2.mst
+++ b/ill_reg_narr_summary2.mst
@@ -65,13 +65,13 @@ This illustration assumes death of the insured at age 
{{EndtAge}}.
 </p>
 
 {{!
-    PDF !! 'MaxAnnLoanDueRate': loan rate actually can vary by year,
+    PDF !! 'MaxAnnCurrLoanDueRate': 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 {{MaxAnnLoanDueRate}} per year.
+The loan interest rate is fixed at {{MaxAnnCurrLoanDueRate}} per year.
 </p>
 
 <p>
diff --git a/interest_rates.hpp b/interest_rates.hpp
index 7c19500..e441387 100644
--- a/interest_rates.hpp
+++ b/interest_rates.hpp
@@ -173,6 +173,9 @@ class InterestRates
         ,double&          AnnualSepAcctSVRate
         );
 
+    std::vector<double> const& RegLoanSpread
+        (mcenum_gen_basis
+        ) const;
     std::vector<double> const& RegLnCredRate
         (mcenum_gen_basis
         ,mcenum_rate_period
@@ -342,6 +345,13 @@ inline std::vector<double> const& InterestRates::MAndERate
     return MAndERate_[gen_basis];
 }
 
+inline std::vector<double> const& InterestRates::RegLoanSpread
+    (mcenum_gen_basis gen_basis
+    ) const
+{
+    return RegLoanSpread_[gen_basis];
+}
+
 inline std::vector<double> const& InterestRates::RegLnCredRate
     (mcenum_gen_basis   gen_basis
     ,mcenum_rate_period rate_period
diff --git a/ledger_evaluator.cpp b/ledger_evaluator.cpp
index 24f984f..2880ff7 100644
--- a/ledger_evaluator.cpp
+++ b/ledger_evaluator.cpp
@@ -454,7 +454,8 @@ format_map_t static_formats()
     ,{"InitAnnSepAcctGuarNet0Rate"      , f4}
     ,{"InitAnnSepAcctGuarNetHalfRate"   , f4}
     ,{"InitAnnSepAcctNetInt"            , f4}
-    ,{"MaxAnnLoanDueRate"               , f4}
+    ,{"MaxAnnGuarLoanSpread"            , f4}
+    ,{"MaxAnnCurrLoanDueRate"           , f4}
     ,{"PostHoneymoonSpread"             , f4}
     ,{"Preferred"                       , f4}
     ,{"PremTaxRate"                     , f4}
diff --git a/ledger_invariant.cpp b/ledger_invariant.cpp
index 66bc595..de38403 100644
--- a/ledger_invariant.cpp
+++ b/ledger_invariant.cpp
@@ -163,7 +163,8 @@ void LedgerInvariant::Alloc(int len)
     OtherScalars    ["PostHoneymoonSpread"   ] = &PostHoneymoonSpread    ;
     OtherScalars    ["SplitMinPrem"          ] = &SplitMinPrem           ;
     OtherScalars    ["ErNotionallyPaysTerm"  ] = &ErNotionallyPaysTerm   ;
-    OtherScalars    ["MaxAnnLoanDueRate"     ] = &MaxAnnLoanDueRate      ;
+    OtherScalars    ["MaxAnnGuarLoanSpread"  ] = &MaxAnnGuarLoanSpread   ;
+    OtherScalars    ["MaxAnnCurrLoanDueRate" ] = &MaxAnnCurrLoanDueRate  ;
     OtherScalars    ["IsInforce"             ] = &IsInforce              ;
     OtherScalars    ["CurrentCoiMultiplier"  ] = &CurrentCoiMultiplier   ;
     OtherScalars    ["NoLapseAlwaysActive"   ] = &NoLapseAlwaysActive    ;
@@ -730,7 +731,8 @@ LedgerInvariant& LedgerInvariant::PlusEq(LedgerInvariant 
const& a_Addend)
 
     ErNotionallyPaysTerm = ErNotionallyPaysTerm || 
a_Addend.ErNotionallyPaysTerm;
 
-    MaxAnnLoanDueRate  = std::max(a_Addend.MaxAnnLoanDueRate, 
MaxAnnLoanDueRate);
+    MaxAnnGuarLoanSpread   = std::max(a_Addend.MaxAnnGuarLoanSpread , 
MaxAnnGuarLoanSpread );
+    MaxAnnCurrLoanDueRate  = std::max(a_Addend.MaxAnnCurrLoanDueRate, 
MaxAnnCurrLoanDueRate);
 
     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 18a18ab..9e99935 100644
--- a/ledger_invariant.hpp
+++ b/ledger_invariant.hpp
@@ -188,7 +188,8 @@ class LMI_SO LedgerInvariant
     double          PostHoneymoonSpread;
     double          SplitMinPrem;
     double          ErNotionallyPaysTerm;
-    double          MaxAnnLoanDueRate;
+    double          MaxAnnGuarLoanSpread;
+    double          MaxAnnCurrLoanDueRate;
     double          IsInforce;
     double          CurrentCoiMultiplier;
     double          NoLapseAlwaysActive;
diff --git a/ledger_invariant_init.cpp b/ledger_invariant_init.cpp
index 8ca2271..7aecb62 100644
--- a/ledger_invariant_init.cpp
+++ b/ledger_invariant_init.cpp
@@ -121,15 +121,21 @@ void LedgerInvariant::Init(BasicValues const* b)
     AddonCompOnAssets    = b->yare_input_.ExtraCompensationOnAssets ;
     AddonCompOnPremium   = b->yare_input_.ExtraCompensationOnPremium;
     CorridorFactor       = b->GetCorridorFactor();
+
+    std::vector<double> z= b->InterestRates_->RegLoanSpread(mce_gen_guar);
+    LMI_ASSERT(!z.empty()); // Ensure *(std::max_element()) works.
+    MaxAnnGuarLoanSpread = *std::max_element(z.begin(), z.end());
+
     AnnLoanDueRate       = b->InterestRates_->RegLnDueRate
         (mce_gen_curr
         ,mce_annual_rate
         );
-    LMI_ASSERT(!AnnLoanDueRate.empty()); // Ensure std::max_element() works.
-    MaxAnnLoanDueRate    = *std::max_element
+    LMI_ASSERT(!AnnLoanDueRate.empty()); // Ensure *(std::max_element()) works.
+    MaxAnnCurrLoanDueRate = *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 8d98052..6a94a8e 100644
--- a/reg_d_indiv_notes1.mst
+++ b/reg_d_indiv_notes1.mst
@@ -158,7 +158,7 @@ money manager (if any).
 </p>
 
 {{!
-    PDF !! 'MaxAnnLoanDueRate': loan rate actually can vary by year,
+    PDF !! 'MaxAnnCurrLoanDueRate': loan rate actually can vary by year,
     so text should say that the fixed loan rate is "guaranteed never
     to exceed" this value.
 }}
@@ -168,7 +168,7 @@ 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 {{MaxAnnLoanDueRate}}.
+reflect a fixed policy loan interest rate of {{MaxAnnCurrLoanDueRate}}.
 </p>
 
 <p>



reply via email to

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