View source: R/f_interface_spending.R
spending | R Documentation |
Fit models for customer spending (currently only the Gamma-Gamma model).
spending(family, data, optimx.args = list(), verbose = TRUE, ...)
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 |
Returns an object of the respective model which was fit.
Spending models for family
: gg.
latentAttrition to fit latent attrition models with a formula interface
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.