lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master d17fda2 20/25: Bring bogosity into focus befo


From: Greg Chicares
Subject: [lmi-commits] [lmi] master d17fda2 20/25: Bring bogosity into focus before eradicating it
Date: Wed, 24 Feb 2021 19:00:54 -0500 (EST)

branch: master
commit d17fda2ba6d28b3a5288c68e8396d05b32f43e95
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Bring bogosity into focus before eradicating it
    
    Split 7702 interest into its four necessary components:
     - gross: greater of statutory or guaranteed
     - net GLP: gross minus applicable sep acct load
     - net GSP: max(stat + 2%, guar) - applicable sep acct load
     - ig: the symbol 'ig' in Eckley's paper
    and one unnecessary one:
     - bogus: interest rate for contractual NAAR discount
    The "bogus" rate is to be used only for "refactoring", to ensure
    that soon-to-be-replaced code can be eradicated without regression.
    Then a correction will be applied, inducing regressions.
---
 irc7702_interest.cpp | 25 +++++++++++++++++++++++--
 irc7702_interest.hpp |  5 +++++
 mec_server.cpp       |  5 ++++-
 3 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/irc7702_interest.cpp b/irc7702_interest.cpp
index 212883e..aa0b2f8 100644
--- a/irc7702_interest.cpp
+++ b/irc7702_interest.cpp
@@ -136,6 +136,27 @@ i7702::i7702
             )
         );
 
-    // 7702 !! WRONG: for 7702, Eckley's 'ig' must be 'gross_' as set above
-    database_.query_into(DB_NaarDiscount, gross_);
+    // Eckley's 'ig' represents the interest rate by which death
+    // benefit is discounted for calculating mortality charges,
+    // as seen in his formula (1):
+    //   [0V + P - Q(1/(1 + ig) - OV - P)] (1 + ic) = 1V
+    // For 7702, that 'ig' should generally be 'gross_' above.
+    //
+    // However, if the contract applies no such discount, then 'ig'
+    // must be zero for formula (1) to apply. As of 2021-02, lmi
+    // supports one ancient product that seems to have no such
+    // discount. This is so extraordinary that it doesn't merit
+    // a special database flag. Instead, the discount is deemed
+    // to be absent iff the contractual discount according to the
+    // product database is uniformly zero.
+
+    std::vector<double> const zero(database_.length(), 0.0);
+    std::vector<double> contractual_naar_discount;
+    database_.query_into(DB_NaarDiscount, contractual_naar_discount);
+    ig_ = (zero == contractual_naar_discount) ? zero : gross_;
+
+    // 7702 !! For the nonce, use this in place of 'ig_' even though
+    // that is wrong, because correcting it in certain old code causes
+    // regressions that will take some effort to resolve.
+    bogus_ = contractual_naar_discount;
 }
diff --git a/irc7702_interest.hpp b/irc7702_interest.hpp
index 89845d5..2f3ea41 100644
--- a/irc7702_interest.hpp
+++ b/irc7702_interest.hpp
@@ -45,9 +45,11 @@ class LMI_SO i7702 final
     i7702& operator=(i7702 const&) = delete;
     ~i7702() = default;
 
+    std::vector<double> const& ig     () const {return ig_;  }
     std::vector<double> const& gross  () const {return gross_;  }
     std::vector<double> const& net_glp() const {return net_glp_;}
     std::vector<double> const& net_gsp() const {return net_gsp_;}
+    std::vector<double> const& bogus  () const {return bogus_;  }
 
     // 7702 !! ephemeral
     std::vector<double> const& spread() const {return spread_;}
@@ -58,9 +60,12 @@ class LMI_SO i7702 final
 
     std::vector<double> spread_;
 
+    std::vector<double> ig_     ;
     std::vector<double> gross_  ;
     std::vector<double> net_glp_;
     std::vector<double> net_gsp_;
+    // 7702 !! deprecated:
+    std::vector<double> bogus_  ;
 };
 
 #endif // irc7702_interest_hpp
diff --git a/mec_server.cpp b/mec_server.cpp
index 4431688..ddd7a9e 100644
--- a/mec_server.cpp
+++ b/mec_server.cpp
@@ -202,7 +202,10 @@ mec_state test_one_days_7702A_transactions
         ;
 #endif // 1
     i7702 const i7702_(database, stratified);
-    LMI_ASSERT(i7702_.gross  () == Mly7702ig);
+//  LMI_ASSERT(i7702_.gross  () == Mly7702ig); // should fail, and does fail
+//  LMI_ASSERT(i7702_.ig     () == Mly7702ig); // should succeed, but fails
+    LMI_ASSERT(i7702_.bogus  () == Mly7702ig); // succeeds, but bogusly
+    LMI_ASSERT(i7702_.gross  () == naar_disc_rate);
     LMI_ASSERT(i7702_.net_glp() == Mly7702iGlp);
 //  LMI_ASSERT(i7702_.net_gsp() == Mly7702iGsp);
     LMI_ASSERT(i7702_.spread () == spread);



reply via email to

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