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
First, thanks a lot for the package. Really useful stuff here.
I noticed what I think is a bug in xbgcnbd.PlotFrequencyInCalibration (and potentially in mcmc.PlotFrequencyInCalibration, but I didn't use it directly).
The behavior at the line x_act <- table(x_act)
is not correct, to me, when a member of the series 0:censor is missing in the table, e.g. if our censor is at 52 and nobody made 20,35, or 45 repeat transactions.
It will not fill with 0 this frequency values and hence x_act will be smaller than x_ect and due to the way R handle this, the matrix will be ... strange (got a warning in Rstudio, didn't in Visual Studio)
It can be fixed by using: x_act <- table(factor(x_act, levels=c(0:censor)))
I know this is a limit case. But I encountered it analysing some 'small' data subset and thought it would be worth rising it up here.
I'd gladly submit a pull request if you want.
Cheers,
Sébastien
Ps: first post actually on github... please don't hate me if I'm too long...
The text was updated successfully, but these errors were encountered:
SebDub
changed the title
Use of table in xbgcnbd.PlotFrequencyInCalibration (and mcmc.PlotFrequencyInCalibratio)
Use of table in xbgcnbd.PlotFrequencyInCalibration (and mcmc.PlotFrequencyInCalibration)
Jan 17, 2019
Hi!
First, thanks a lot for the package. Really useful stuff here.
I noticed what I think is a bug in xbgcnbd.PlotFrequencyInCalibration (and potentially in mcmc.PlotFrequencyInCalibration, but I didn't use it directly).
The behavior at the line
x_act <- table(x_act)
is not correct, to me, when a member of the series 0:censor is missing in the table, e.g. if our censor is at 52 and nobody made 20,35, or 45 repeat transactions.
It will not fill with 0 this frequency values and hence x_act will be smaller than x_ect and due to the way R handle this, the matrix will be ... strange (got a warning in Rstudio, didn't in Visual Studio)
It can be fixed by using:
x_act <- table(factor(x_act, levels=c(0:censor)))
See this toy example to understand what i mean:
I know this is a limit case. But I encountered it analysing some 'small' data subset and thought it would be worth rising it up here.
I'd gladly submit a pull request if you want.
Cheers,
Sébastien
Ps: first post actually on github... please don't hate me if I'm too long...
The text was updated successfully, but these errors were encountered: