CLVTools icon indicating copy to clipboard operation
CLVTools copied to clipboard

Dyncov plot in some cases 1 period shifted from actuals

Open pschil opened this issue 5 years ago • 2 comments

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:

  • [x] actual repeat transactions of last period until plotting point
  • [x] model expectation of last period until plotting point
  • [x] tests that very first expectation and repeat trans are always 0 (clv.fitted and clv.data)
  • [x] clarify documentation of period definitions and returned data for plot of clv.fitted and clv.data
  • [x] rename column of returned data from period.first to period.until

pschil avatar Apr 19 '20 01:04 pschil

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 avatar Apr 26 '20 23:04 pschil

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

pschil avatar Apr 29 '20 17:04 pschil