Giter VIP home page Giter VIP logo

experienceanalysis.jl's People

Contributors

alecloudenback avatar matthewcaseres avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

experienceanalysis.jl's Issues

ability to toggle creation of partial exposures on left and right

actxps maintainer (mattheaphy/actxps#23) and SOA experience studies document indicate that not including partial exposures on left truncation is standard practice. Asking in linked issue about right truncation as well.

update: in linked issue the approach taken by actxps is to not include left truncation intervals but to include right truncation intervals. Not entirely sure of the consistency of these things. Maybe some simulated scenarios can help understand these things without going through the math. Or maybe going through the math is necessary. A bit unsure.

update 2: seems to be consistent with the advice from section 17.6.4 of experience studies document.

Change representation of date intervals

How to interpret dates in this package?

suppose we get this result from exposure function

[(from = Date("2016-07-04"), to = Date("2017-07-04")), (from = Date("2017-07-04"), to = Date("2017-07-05"))]

because res[1].to == res[2].from, I assume that they both refer to the same time on the clock (midnight?) so that there is no overlap. But if we get this result

[(from = Date("2016-07-04"), to = Date("2016-07-04"))]

then the interval of time represented by it contains only a single instant and has exposure of 0?

I propose an alternative -

How I would like to do it

first result

[(from = Date("2016-07-04"), to = Date("2017-07-03")), (from = Date("2017-07-04"), to = Date("2017-07-05"))]

second result

[(from = Date("2016-07-04"), to = Date("2016-07-04"))]

interpretation

supposing we have implemented study_start and study_end

How I interpret inputs -

  • issue is the Dates.Date containing the Dates.Instant where the policy was issued
  • termination is the Dates.Date containing the Dates.Instant where the policy was terminated
  • study_start includes the entire day, starts at midnight
  • study_end includes the entire day, ends at 23:59.9999... military time

How I interpret the outputs -

  • tuple.from is the beginning of the date interval. How does this relate to the Date.Instant where policy is issued?
    • If issue < study_start then the first interval's tuple.from refers to midnight/beginning of day, so that the entire day is included.
    • If issue >= study_start then the first interval's tuple.from might most accurately be a Dates.Instant, but we simplify things by allowing tuple.from to start at midnight, so that there is a full exposure and that we are consistent with our other case.
  • tuple.to is the end of the date interval. How does this relate to the Date.Instant where policy is terminated or where the study ends?
    • if study_end < termination then we suppose that the study_end means we should include the entire day of study_end and the Dates.Instant of tuple.to is at 23:59.999 military time.
    • if study_end >= termination then the termination happens at some time during this day, but we simplify by allowing tuple.to to end at 23:59.999.

In this interpretation the simplification causes some error, maybe some analysis should be done to estimate or put bounds on this error. Maybe this is done in that document from the SOA linked in the description.

`from > to` results in bad interval

exposure(Anniversary(Month(1)), Date(2013, 1, 31), Date(2012, 4, 1))

gives

1-element Vector{NamedTuple{(:from, :to), Tuple{Date, Date}}}:
 (from = Date("2013-01-31"), to = Date("2012-04-01"))

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

can exposure allocate just once?

Thinking about an API that just returns an iterator of dates for the partitions.

Think it can be faster than pushing to array? Also maybe less opinionated than doing the NamedTuple with from and to.

stricter typings

We have code like

struct Anniversary{T} <: ExposurePeriod
    pol_period::T
end

but I think it should be something like

struct Anniversary <: ExposurePeriod
    pol_period::Period
end

and probably even as strict as

struct Anniversary <: ExposurePeriod
    pol_period::DatePeriod
end

I don't think there it necessary to operate at any granularity finer than a single day, so I am going to be using DatePeriod instead of Period in a PR.

stricter types, change Period to DatePeriod

reproduction

using ExperienceAnalysis
using Dates

exposure(ExperienceAnalysis.Calendar(Year(1)), Date(2006,6,15), Date(2020,2,29), true) # works
exposure(ExperienceAnalysis.Calendar(Hour(1)), Date(2006,6,15), Date(2020,2,29), true) # ERROR: MethodError: no method matching floor(::Date, ::Hour)

This is because floor of date only works for DatePeriod

Anchor points and study truncation

Currently, exposures(basis,from,to,continued_exposure=false) uses the from argument as the anchor point for anniversaries. Refactor to allow the study start to be incorporated? Currently process is a little clunky.

Alternative API could be: exposure(basis,anniv_date,termination_date,study_start,study_end,continued_exposure=false)

This is also not ideal because termination_date could be a date, or nothing, or missing or however user has data stored. Perhaps enforce that it must be a date or nothing?

remove continued_exposure

Seems like just indicating that the interval is the final interval and contains the decrement we are analyzing will work. I am not sure how continued_exposure will work for AnniversaryCalendar. The equation is probably like $\frac{events}{exposures}$?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.