Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dyncov plot in some cases 1 period shifted from actuals #78

Open
5 tasks done
pschil opened this issue Apr 19, 2020 · 2 comments
Open
5 tasks done

Dyncov plot in some cases 1 period shifted from actuals #78

pschil opened this issue Apr 19, 2020 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@pschil
Copy link
Collaborator

pschil commented Apr 19, 2020

The actual and expected repeat transactions are shifted by a period because they currently are (wrongfully) defined differently: Repeat transactions are currently implemented as "forward-looking", ie the number of transactions in the period that starts at the plotting point whereas expected transactions are implemented as "backward-looking", ie expected transactions in the period that end at the plotting point.

The BTYD package implements this backward-looking which can be seen from the plot which at the estimation start has a hard-coded zero for the expectation (see BTYD::dc.CumulativeToIncremental). For consistency with the plots from BTYD, the plot in CLVTools is also implemented as backward-looking.

This requires to implement:

  • actual repeat transactions of last period until plotting point
  • model expectation of last period until plotting point
  • tests that very first expectation and repeat trans are always 0 (clv.fitted and clv.data)
  • clarify documentation of period definitions and returned data for plot of clv.fitted and clv.data
  • rename column of returned data from period.first to period.until
@pschil pschil self-assigned this Apr 19, 2020
@pschil pschil added the bug Something isn't working label Apr 19, 2020
@mmeierer mmeierer added this to the v0.5 milestone Apr 19, 2020
@mmeierer mmeierer modified the milestones: v0.5, v0.6 Apr 20, 2020
@pschil pschil modified the milestones: v0.6, v0.5 Apr 20, 2020
@pschil
Copy link
Collaborator Author

pschil commented Apr 26, 2020

Still existing issues

Kink
Because of the dyncov model, the plotting points are currently set to be on the covariate dates. This often causes the second plotting point to be spaced less than 1 period from the first plotting point (estimation start) what again implies that the expectation at the second plotting point is calculated only as a partial period. This partial period leads to a "kink" in the plot at the beginning.

Shifted Periods
For some cases, the exepectation values are still shifted by what seems exactly 1 period from the actual transactions.

pschil added a commit that referenced this issue Apr 27, 2020
- Roll repeat transactions forward
- tests for actual and expected trans = 0
- replace period.first with period.until
- clarify documentation on plotting points (period.until)
Contributes to #78
@pschil
Copy link
Collaborator Author

pschil commented Apr 29, 2020

Postponed to next release. The kink is not so much of an issue and the shifted periods could not be found, yet.

@pschil pschil modified the milestones: v0.5, v0.6 Apr 29, 2020
@mmeierer mmeierer modified the milestones: v0.6, v0.7 Jun 2, 2020
@mmeierer mmeierer modified the milestones: v0.7, v0.8 Jul 22, 2020
@mmeierer mmeierer removed this from the v0.9 milestone Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants