# \donttest{
data("apparelTrans")
clv.data.apparel <- clvdata(apparelTrans, date.format = "ymd",
time.unit = "w", estimation.split = 52)
# Fit the gg model
gg(clv.data.apparel)
# Give initial guesses for the model parameters
gg(clv.data.apparel,
start.params.model = c(p=0.5, q=15, gamma=2))
# pass additional parameters to the optimizer (optimx)
# Use Nelder-Mead as optimization method and print
# detailed information about the optimization process
apparel.gg <- gg(clv.data.apparel,
optimx.args = list(method="Nelder-Mead",
control=list(trace=6)))
# estimated coefs
coef(apparel.gg)
# summary of the fitted model
summary(apparel.gg)
# Plot model vs empirical distribution
plot(apparel.gg)
# predict mean spending and compare against
# actuals in the holdout period
predict(apparel.gg)
# }
Run the code above in your browser using DataLab