summary.clv.fitted {CLVTools} | R Documentation |
Summarizing a fitted CLV model
Description
Summary method for fitted CLV models that provides statistics about the estimated parameters
and information about the optimization process. If multiple optimization methods were used
(for example if specified in parameter optimx.args
), all information here refers to
the last method/row of the resulting optimx
object.
Usage
## S3 method for class 'clv.fitted'
summary(object, ...)
## S3 method for class 'clv.fitted.transactions.static.cov'
summary(object, ...)
## S3 method for class 'summary.clv.fitted'
print(
x,
digits = max(3L, getOption("digits") - 3L),
signif.stars = getOption("show.signif.stars"),
...
)
Arguments
object |
A fitted CLV model |
... |
Ignored for |
x |
an object of class |
digits |
the number of significant digits to use when printing. |
signif.stars |
logical. If TRUE, ‘significance stars’ are printed for each coefficient. |
Value
This function computes and returns a list of summary information of the fitted model
given in object
. It returns a list of class summary.clv.no.covariates
that contains the
following components:
name.model |
the name of the fitted model. |
call |
The call used to fit the model. |
tp.estimation.start |
Date or POSIXct indicating when the fitting period started. |
tp.estimation.end |
Date or POSIXct indicating when the fitting period ended. |
estimation.period.in.tu |
Length of fitting period in |
time.unit |
Time unit that defines a single period. |
coefficients |
a |
estimated.LL |
the value of the log-likelihood function at the found solution. |
AIC |
Akaike's An Information Criterion for the fitted model. |
BIC |
Schwarz' Bayesian Information Criterion for the fitted model. |
KKT1 |
Karush-Kuhn-Tucker optimality conditions of the first order, as returned by optimx. |
KKT2 |
Karush-Kuhn-Tucker optimality conditions of the second order, as returned by optimx. |
fevals |
The number of calls to the log-likelihood function during optimization. |
method |
The last method used to obtain the final solution. |
additional.options |
A list of additional options used for model fitting.
|
For models fits with static covariates, the list additionally is of class summary.clv.static.covariates
and the list in additional.options
contains the following elements:
additional.options |
|
See Also
The model fitting functions pnbd
.
Function coef
will extract the coefficients
matrix including summary statistics and
function vcov
will extract the vcov
from the returned summary object.
Examples
data("apparelTrans")
# Fit pnbd standard model, no covariates
clv.data.apparel <- clvdata(apparelTrans, time.unit="w",
estimation.split=40, date.format="ymd")
pnbd.apparel <- pnbd(clv.data.apparel)
# summary about model fit
summary(pnbd.apparel)
# Add static covariate data
data("apparelStaticCov")
data.apparel.cov <-
SetStaticCovariates(clv.data.apparel,
data.cov.life = apparelStaticCov,
names.cov.life = "Gender",
data.cov.trans = apparelStaticCov,
names.cov.trans = "Gender",
name.id = "Id")
# fit model with covariates and regualization
pnbd.apparel.cov <- pnbd(data.apparel.cov,
reg.lambdas = c(life=2, trans=4))
# additional summary about covariate parameters
# and used regularization
summary(pnbd.apparel.cov)