You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
""" long(m::MortalityTable)Return an array of tuples containing `issue_age`,`attained_age`,`duration`,`select` rate, and `ultimate` rate."""functionlong(m::MortalityTables.SelectUltimateTable)
earliest_age =min(firstindex(m.select),firstindex(m.ultimate))
last_age =max(lastindex(m.select),lastindex(m.ultimate))
table =map(earliest_age:last_age) do issue_age
map(issue_age:last_age) do attained_age
# use `get` to provide default missing value
ultimate =get(m.ultimate,attained_age,missing)
if issue_age <=lastindex(m.select)
select =get(m.select[issue_age],attained_age,missing)
else
select =missingend
duration = attained_age - issue_age +1
(;issue_age,attained_age, duration, select,ultimate)
endendvcat(table...)
end""" long(m::MortalityTable)Return an array of tuples containing `issue_age`,`attained_age`,`duration`,`select` rate, and `ultimate` rate."""functionlong(m::MortalityTables.UltimateTable)
earliest_age =firstindex(m.ultimate)
last_age =lastindex(m.ultimate)
table =map(earliest_age:last_age) do issue_age
map(issue_age:last_age) do attained_age
# use `get` to provide default missing value
ultimate =get(m.ultimate,attained_age,missing)
select =missing
duration = attained_age - issue_age +1
(;issue_age,attained_age, duration, select,ultimate)
endendvcat(table...)
end
@MatthewCaseres are you suggesting providing some sort of "table set" interface (e.g. a way to get all of CS0 2017 together) or about the layout of the tables themselves (i.e. how a "long" version of the tables should look)?
I think both? I reconsidered my original idea of what a long mortality table was, and now am just trying to replicate the structure of a relational database, so that is what influences the design of the Relational() object.
Table groupings are derived from the metadata table's study/group fields. I am about to ship this - actuarialopensource/pymort@8bdfec8 which takes the metadata table and provides the table set interface.
End goal of #109
Preliminary work completed in example here: https://juliaactuary.org/tutorials/mortalitytablesdataframe/
To-dos
long
the right function name?The text was updated successfully, but these errors were encountered: