lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 2a7f972 3/3: Respect minimum when solving for


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 2a7f972 3/3: Respect minimum when solving for specamt [381]
Date: Tue, 14 Nov 2017 12:57:54 -0500 (EST)

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

    Respect minimum when solving for specamt [381]
    
    Solves generally search for a root in [0, 999999999.99]. However,
    specified amount usually has a product-specific lower bound greater
    than zero. This hasn't seemed to matter in the past, but now it does
    with the new NAAR solve: the objective function is ill-conditioned in
    that range when solving for specamt to yield a particular target NAAR.
    
    For example, if the minimum specamt is 50000, such a solve might test
    iterands such as 0, 1, 10, 100 at the lower end, all of which are
    transformed to 50000, producing the same value of the objective
    function, and in effect signalling to Brent's algorithm that reducing
    the LUB is more profitable than increasing the GLB. Unfortunately, in
    realistic test cases, this results in bracketing a discontinuity such
    that the contract lapses at the target duration. Respecting the
    minimum--in this example, solving in [50000, 999999999.99]--allows
    the desired root to be found.
---
 ihs_avsolve.cpp | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/ihs_avsolve.cpp b/ihs_avsolve.cpp
index b71676d..f644ee9 100644
--- a/ihs_avsolve.cpp
+++ b/ihs_avsolve.cpp
@@ -370,7 +370,14 @@ double AccountValue::Solve
 // is not satisfactory; what would be better?
             solve_set_fn = &AccountValue::SolveSetSpecAmt;
             decimals     = round_specamt().decimals();
-            // TODO ?? Respect minimum specamt?
+            // Generally, base and term are independent, and it is
+            // the base specamt that's being solved for here, so set
+            // the minimum as though there were no term.
+            lower_bound = minimum_specified_amount
+                (  0 == SolveBeginYear_
+                && yare_input_.EffectiveDate == yare_input_.InforceAsOfDate
+                ,false
+                );
             }
             break;
         case mce_solve_ee_prem:



reply via email to

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