lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 46b9de9 5/8: Regularize compositing of non-ad


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 46b9de9 5/8: Regularize compositing of non-additive vectors
Date: Thu, 9 Apr 2020 18:33:05 -0400 (EDT)

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

    Regularize compositing of non-additive vectors
    
    Formerly, these vectors had potentially different lengths than the
    additive vectors in a composite, and most were all zero. Now, at
    least they all have the appropriate length, so that accessing the
    value in the year preceding maturity won't cause a crash. The value
    for each (yearly) element is overwritten by the last addend that
    contains such an element; that's what 'LedgerVariant' does for such
    vectors already, and it's arguably the best simple, uniform method
    that can be devised.
---
 ledger_invariant.cpp | 30 ++++++++++++++++++------------
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/ledger_invariant.cpp b/ledger_invariant.cpp
index 35120d3..627c13b 100644
--- a/ledger_invariant.cpp
+++ b/ledger_invariant.cpp
@@ -766,22 +766,28 @@ LedgerInvariant& LedgerInvariant::PlusEq(LedgerInvariant 
const& a_Addend)
     SmokerDistinct                = a_Addend.SmokerDistinct;
     SmokerBlended                 = a_Addend.SmokerBlended;
 
-    PartMortTableMult             = a_Addend.PartMortTableMult;
-    TotalIMF                      = a_Addend.TotalIMF;
-    RefundableSalesLoad           = a_Addend.RefundableSalesLoad;
-
-    // PDF !! This is the logic used in the variant ledger class.
-    // It's not a very good idea, but until it can be replaced
-    // everywhere, at least it ensures that the composite value
-    // isn't zero. (In some other cases, zero might be a sensible
-    // answer--e.g., for ratios like 'CorridorFactor', where an
-    // average weighted by number of lives would be inaccurate,
-    // and any aggregate value could be misleading.)
+    // For 'CorridorFactor', an average weighted by number of lives
+    // would be inaccurate, and indeed any aggregate value could be
+    // surprising because it would not necessarily be monotone (for
+    // two lives with a ten-year age difference, the last ten would
+    // depend on the younger life only, most likely producing a
+    // discontinuity at the older life's maturity age).
     //
     // ET !! This is of the form 'x[iota rho y] gets y'.
     for(int j = 0; j < a_Addend.Length; ++j)
         {
-        AnnLoanDueRate[j] = a_Addend.AnnLoanDueRate[j];
+        IndvTaxBracket       [j] = a_Addend.IndvTaxBracket       [j];
+        CorpTaxBracket       [j] = a_Addend.CorpTaxBracket       [j];
+        AnnualFlatExtra      [j] = a_Addend.AnnualFlatExtra      [j];
+        HoneymoonValueSpread [j] = a_Addend.HoneymoonValueSpread [j];
+        PartMortTableMult    [j] = a_Addend.PartMortTableMult    [j];
+        AddonCompOnAssets    [j] = a_Addend.AddonCompOnAssets    [j];
+        AddonCompOnPremium   [j] = a_Addend.AddonCompOnPremium   [j];
+        CorridorFactor       [j] = 0.0;
+        AnnLoanDueRate       [j] = a_Addend.AnnLoanDueRate       [j];
+        CurrMandE            [j] = a_Addend.CurrMandE            [j];
+        TotalIMF             [j] = a_Addend.TotalIMF             [j];
+        RefundableSalesLoad  [j] = a_Addend.RefundableSalesLoad  [j];
         }
 
     IsMec                         = a_Addend.IsMec        || IsMec;



reply via email to

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