lifelib-dev/lifelib

Problems about simplelife project (19/2/2019)

Closed this issue · 6 comments

Hi, the following are the issues I have encountered. There are 3 types of issues.

  1. Problems: those I think are errors.
  2. improvements: those that may be improved.
  3. Inquiries: those that I dont understand.

1 Problems:
1.1. In projection.py, there is a variable called SizeExpsCommInit, which includes CnsmpTax. SizeExpsCommInit is included in ExpsTotal, which is included in ProfitBefTax. But by definition, ProfitBefTax should be something before tax.

2 Improvements:
2.1. in assumption.py, there is a variable called ExpsMaintAnnPrem, but the variable name in input.xlsx is ExpsMaintPrem. It is better to be consistent.
2.2. (already mentioned in the python script) in lifetable.py, the calculation for actuarial symbols should stop until last age but not 110.

3 Inquiries:
3.1. in policy.py, why for NetPremRate, several calculations of AnnDuenx all assumes payment frequency is 1, instead of 12(actual frequency). Is this the definition?
3.2. in policy.py, for NetPremRate->AnnDuenx, what does "m" means (compared to "n")? I find that you set both m and n to policy term.
3.3. I dont know how to find out the "RateBasis" of the policy. I assume it is "PREM"
3.4. for economic py, what is the difference between DiscRate and InvstRetRate? I guess DiscRate is related to CF and InvstRetRate is related to profit.
3.5.for projection.py, what is the difference between SizeReservePremRsrvAftMat and SizeReservePremRsrvEnd? why SizeInvstIncome uses SizeReservePremRsrvAftMat but not SizeReservePremRsrvEnd?
3.6. What does "Gen" stands for?
3.7. in input.xlsx, AssumptionTables tab contain a column called LapseRate1. I use that column for surrender rate. The problem is that column only contain 20 years' data. Therefore, my results will contain many errors after 20 years. How is the real logic in the python project going on here?
3.8. For my "checking.xlsx" file. I want to generate all the variables from projection.py and then compare them with my results obtained in "calculation.xlsm". What I currently do is to run "plot_simplelife.py", then run "df=proj.to_frame()". df here only contain fifty-something variables, not the eighty-something variables listed in "projection.py".

1.1. In projection.py, there is a variable called SizeExpsCommInit, which includes CnsmpTax. SizeExpsCommInit is included in ExpsTotal, which is included in ProfitBefTax. But by definition, ProfitBefTax should be something before tax.

CnsmpTax stands for Consumption Tax, a.k.a sales tax on commissions, while "Tax" as in ProfitBefTax corporate income tax.

2.1. in assumption.py, there is a variable called ExpsMaintAnnPrem, but the variable name in input.xlsx is ExpsMaintPrem. It is better to be consistent.

Makes sense. AnnPrem in ExpsMaintAnnPrem was suppored to mean Annualized Premium but ExpsMaintAnnPrem is just returning ExpsMaintPrem.

2.2. (already mentioned in the python script) in lifetable.py, the calculation for actuarial symbols should stop until last age but not 110.

Makes sense.

3.1. in policy.py, why for NetPremRate, AnnDuenx/ AnnDuenx all assumes payment frequency is 1, instead of 12(actual frequency). Is this the definition?

The practice may vary by countries or regions, but in this model the net premium rate of a policy is expressed based on an annual payament mode regardless of the actual payment frequency of the policy. On the other hand, the gross premium rate considers payament frequency. I think the distinction is because while gross premium figures are visible to the policyholders, net premiums are only an internal concept.

3.2. in policy.py, for NetPremRate->AnnDuenx, what does "m" means (compared to "n")? I find that you set both m and n to policy term.

m: premium payment period

n: coverage period

3.3. I dont know how to find out the "RateBasis" of the policy. I assume it is "PREM"

RateBasis is not a policy attribute. In such a country where a standard reserving method is enforced, you need to calculate reserves with standard valuation rates, which are usually different from the pricing assumptions.

3.4. for economic py, what is the difference between DiscRate and InvstRetRate? I guess DiscRate is related to CF and InvstRetRate is related to profit.

InvstRetRate is for investemnt returns. DiscRate is for calculating present values. These are set to be equal by default, but meant to be customized by the user to meet their own purposes.

3.5.for projection.py, what is the difference between SizeReservePremRsrvAftMat and SizeReservePremRsrvEnd? why SizeInvstIncome uses SizeReservePremRsrvAftMat but not SizeReservePremRsrvEnd?

The sample model is simple so no difference in these cells. Postfixes in cells names like End and AftMat denote the timing of the events such as end of a period, or after maturity.

3.6. What does "Gen" stands for?

Generation. see https://lifelib.io/projects/devguide/naming_convention.html

3.7. in input.xlsx, AssumptionTables tab contain a column called LapseRate1. I use that column for surrender rate. The problem is that column only contain 20 years' data. Therefore, my results will contain many errors after 20 years. How is the real logic in the python project going on here?

model.Input.AssumptionTables.LapseRate1(y) returns None when no input value is found, which is captured by model.Assumption.SurrRate
defined here: https://lifelib.io/_modules/simplelife/assumption.html#SurrRate

if None is returned from LapseRate1, then SurrRate(y-1) is referenced.

3.8. For my "checking.xlsx" file. I want to generate all the variables from projection.py and then compare them with my results obtained in "calculation.xlsm". What I currently do is to run "plot_simplelife.py", then run "df=proj.to_frame()". df here only contain fifty-something variables, not the eighty-something variables listed in "projection.py".

It's probably because those cells are not calculated beforehand.
plot_simplelife only calculate cashflow items, so those cells such as reserves that are not used by the cashflow calculations are not yet calculated. proj.to_frame() will only include cells that has values already.

Thanks for the comments! I will study them carefully tomorrow.

I have read through your comments carefully and agree with all of them. I will close this issue if there are no further explanation about the questions. I will update my excel files soon (especially to solve point 3.8) and upload it in the previous issue. Thanks.

I am sorry that I have another problem. Using the code attached, if you type "proj.PolsDeath" in the MxAnalyzer, following BaseMortRate->MortalityTable, you see that the table uses Input.MortalityTables[3] in the Space column. However, if you type "proj.SizeReservePremRsrvAftMat" in the analyzer, following NLPRate->Axn->Dx->lx->dx->qx you see that it uses Input.MortalityTables[1], which is confusing to me.
code_went_wrong.zip

proj.SizeReservePremRsrvAftMat calculates reserves, so it uses valuation mortality rates. proj.PolsDeath number of death, so this should use mortality rates for cashflow projections. These two mortality rates are not necessarily the same.

Thank you for your answer! I will update the excel worksheet about simplelife after I study modelx.