# NOT RUN {
data(cdnowSummary)
ave.spend <- cdnowSummary$m.x
tot.trans <- cdnowSummary$cbs[,"x"]
# params <- c(6, 4, 16); # in original documentation. rounded values of:
params <- spend.EstimateParameters(m.x.vector = ave.spend, x.vector = tot.trans);
# calculate the expected transaction value of a customer
# who spent an average of $35 over 3 transactions.
spend.expected.value(params, m.x=35, x=3)
# m.x and x may be vectors:
spend.expected.value(params, m.x=30:40, x=3)
spend.expected.value(params, m.x=35, x=1:10)
spend.expected.value(params, m.x=30:40, x=1:11)
# }
Run the code above in your browser using DataLab