lifelib-dev/lifelib

error reporting & errors running BasicTerm_SE default (simulated) data

Closed this issue · 5 comments

Hi,

On BasicTerm_SE using default (simulated) data:

Point ids such as 581, 956 are failing because they are future NB, age 20 at sale, but that's in almost 3 years.

Even though mortality before sale doesn't affect calculations, there are mortality table lookups which cause failure (mort_table.xlsx starts at age 18; lookups for age 17 fail).

I think this is a relatively easy fix to the basic term logic.

Maybe more visibility about errors would be useful, e.g. an error count, which can be included with result_pv, which is missing results in cases such as this?

Thanks for the report. I'll take closer look at it this weekend.

I added is_active(t) and made pols_death check it before reading mortality rates. f5fe26c

I'm not entirely sure about the error visibility in result_pv. result_pv should throw error if something goes wrong in the projection for a selected model point, right?

Thanks for that fix!

You're right about result_pv for a selected model point, but this aggregate for the Projection is missing values:

(before the fix)

image

Here, it isn't obvious that there are missing values due to errors.

That's not the aggregated result. It's showing PVs for a single model point (point 1). You can check model.Projection.point_id.
To change the selected model point to, say 581:

model.Projection.point_id = 581
model.Projection.result_pv()

This throws an error before the fix.

Oh, correct! So no danger here and closing, thanks!