spending {CLVTools} | R Documentation |
Formula Interface for Spending Models
Description
Fit models for customer spending (currently only the Gamma-Gamma model).
Usage
spending(family, data, optimx.args = list(), verbose = TRUE, ...)
Arguments
family |
A spending model (currently only |
data |
A |
optimx.args |
Additional arguments to control the optimization which are forwarded to |
verbose |
Show details about the running of the function. |
... |
Forwarded to model specified in |
Value
Returns an object of the respective model which was fit.
See Also
Spending models for family
: gg.
latentAttrition to fit latent attrition models with a formula interface
Examples
data("cdnow")
clv.cdnow <- clvdata(data.transactions = cdnow, date.format="ymd",
time.unit = "weeks")
# Fit gg
spending(family=gg, data=clv.cdnow)
# Fit gg with start params
spending(family=gg, data=clv.cdnow,
start.params.model=c(p=0.5, q=15, gamma=2))
# Fit gg, do not remove first transaction
spending(family=gg, data=clv.cdnow, remove.first.transaction=FALSE)
## No formula may be given to specify covariates because currently
## no spending model uses covariates
[Package CLVTools version 0.11.2 Index]