ltmmCombo {ltmix} | R Documentation |
Fit a Left-truncated mixture model (LTMM)
Description
This function fits a family of finite mixture models using every combination of the left-truncated lognormal, gamma, and weibull distributions.
Usage
ltmmCombo(
x,
G,
distributions = c("lognormal", "gamma", "weibull"),
trunc = NULL,
EM_init_method = "emEM",
EM_starts = 5,
init_pars = NULL,
init_pi = NULL,
init_classes = NULL,
one_group_reps = 50,
eps = 1e-06,
max.it = 1000,
verbose = FALSE,
parallel = FALSE,
cores = NULL,
save_each_fit = FALSE
)
Arguments
x |
data vector |
G |
number of components |
distributions |
densities to combine |
trunc |
left truncation point (optional) |
EM_init_method |
initialization method for EM algorithm |
EM_starts |
number of random starts for initialization of EM algorithm. (only for G > 1) |
init_pars |
initial parameter values (list of length G) |
init_pi |
manually specified initial component proportions (for init_method=specified) |
init_classes |
manually specified initial classes. will overwrite init_pars and init_pi |
one_group_reps |
number of random starts for each numerical optimization in 1-component model |
eps |
stopping tolerance for EM algoithm |
max.it |
maximum number of iterations of EM algorithm |
verbose |
print information as fitting progresses? |
parallel |
fit models in parallel? |
cores |
number of processes used for parallel computation. if NULL detect.cores() used |
save_each_fit |
save each model as it is produced, in a time-stamped directory (safer) |
Value
An ltmmCombo model object, with the following properties:
- x
Copy of the input data
- distributions
The selected distributions
- combos
List of all combinations of distributions considered
- all.fits
List of all ltmm fit objects
- all.bic
Vector of BIC values for each model
- best.bic.fit
The best ltmm fit by BIC
- best.bic
The best BIC value of all fits
- best.bic.combo
The combination of distributions used for the best fit by BIC
- all.aic
Vector of AIC value for each model
- best.aic.fit
The best ltmm fit by AIC
- best.aic
The best AIC value of all fits
- best.aic.combo
The combination of distributions used for the best fit by AIC
- all.ll
Vector of log-likelihood value for each model
- summary_table
Table summarizing the AIC, BIC, LL, and risk measures for each fitted model
References
Blostein, Martin & Miljkovic, Tatjana. (2019). On modeling left-truncated loss data using mixtures of distributions. Insurance Mathematics and Economics. 85. 35-46. 10.1016/j.insmatheco.2018.12.001.
Examples
x <- secura$Loss
fits_GL <- ltmmCombo(x, G = 2, distributions = c('gamma', 'lognormal'), trunc = 1.2e6)
summary(fits_GL)