[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] odd/irc7702_2pct f553226 2/2: Calculate some 2017 CS
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] odd/irc7702_2pct f553226 2/2: Calculate some 2017 CSO values at the 2% 7702 interim rate |
Date: |
Tue, 12 Jan 2021 22:38:13 -0500 (EST) |
branch: odd/irc7702_2pct
commit f5532262579120402c3533e009e91943591ef09e
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Calculate some 2017 CSO values at the 2% 7702 interim rate
This is a throwaway commit, kept on a branch for the time being
because otherwise it would be needed again.
---
irc7702_tables.cpp | 3 ++-
irc7702_tables_test.cpp | 60 +++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 62 insertions(+), 1 deletion(-)
diff --git a/irc7702_tables.cpp b/irc7702_tables.cpp
index 582fd47..e340102 100644
--- a/irc7702_tables.cpp
+++ b/irc7702_tables.cpp
@@ -27,7 +27,8 @@
#include "commutation_functions.hpp"
#include "cso_table.hpp"
#include "et_vector.hpp"
-#include "irc7702_interest.hpp" // iglp()
+//#include "irc7702_interest.hpp" // iglp()
+static double iglp() {return 0.02;}
#include "math_functions.hpp"
#include "ssize_lmi.hpp"
diff --git a/irc7702_tables_test.cpp b/irc7702_tables_test.cpp
index 3927ef3..9429247 100644
--- a/irc7702_tables_test.cpp
+++ b/irc7702_tables_test.cpp
@@ -451,6 +451,65 @@ static double const ss_ol_7pp[100] =
};
/// Test CVAT corridor and seven-pay premium.
+#include <iomanip> // fixed, setprecision()
+
+void foo()
+{
+ constexpr int maturity_age = 95;
+ std::vector<double> const naar_discount
+ (maturity_age
+ ,i_upper_12_over_12_from_i<double>()(0.02)
+ );
+ irc7702_tables f
+ (mce_2017cso
+ ,oe_orthodox
+ ,oe_age_nearest_birthday_ties_older
+ ,mce_female
+ ,mce_unismoke
+ ,naar_discount
+ ,1.0 / 12.0
+ ,0
+ ,maturity_age
+ );
+ irc7702_tables m
+ (mce_2017cso
+ ,oe_orthodox
+ ,oe_age_nearest_birthday_ties_older
+ ,mce_male
+ ,mce_unismoke
+ ,naar_discount
+ ,1.0 / 12.0
+ ,0
+ ,maturity_age
+ );
+ irc7702_tables u
+ (mce_2017cso
+ ,oe_orthodox
+ ,oe_age_nearest_birthday_ties_older
+ ,mce_unisex
+ ,mce_unismoke
+ ,naar_discount
+ ,1.0 / 12.0
+ ,0
+ ,maturity_age
+ );
+
+ std::cout << "age, cvat corr [FMU], 7pp [FMU]\n";
+ for(int j = 0; j < lmi::ssize(ss_ul_corr); ++j)
+ {
+ std::cout
+ << j
+ << std::setprecision(7) << std::fixed
+ << '\t' << f.ul_corr()[j]
+ << '\t' << m.ul_corr()[j]
+ << '\t' << u.ul_corr()[j]
+ << '\t' << f.ul_7pp ()[j]
+ << '\t' << m.ul_7pp ()[j]
+ << '\t' << u.ul_7pp ()[j]
+ << '\n';
+ }
+ std::cout << std::endl;
+}
void Test_Corridor_and_7PP()
{
@@ -596,6 +655,7 @@ void Test_Corridor_and_7PP()
int test_main(int, char*[])
{
Test_Corridor_and_7PP();
+ foo();
return EXIT_SUCCESS;
}