elog2cbs: Convernt Event Log to customer-level summary statistic.
Description
Takes the event log of a customer cohort, and returns a sufficient summary statistic for applying common BTYD models.
Usage
elog2cbs(elog, per = "week", T.cal = max(elog$date),
T.tot = max(elog$date))
Arguments
elog
Event log, a data.frame with columns cust and
transaction time t or date. If column sales is
present, it will be aggregated as well.
per
Time unit, either 'week', 'day', 'hour', 'min', 'sec'.
T.cal
End date of calibration period.
T.tot
End date of holdout period.
Value
data.frame with fields
cust
customer id (unique key)
x
number of recurring events in calibration period
t.x
time between first and last event in calibration period
litt
sum of logarithmic intertransaction timings durint calibration period
sales
sum of sales in calibration period
first
date of first transaction in calibration period
T.cal
time between first event and end of calibration period
T.star
length of holdout period
x.star
number of events within holdout period
sales.star
sum of sales within holdout period
Details
Note: compared to dc.ElogToCbsCbt this also adds a summary statistic for estimating regularity.
Customers without any transaction during calibration period are being dropped from the result. Transactions with identical cust and date field are treated as a single transaction, with `sales` being summed up