This function fits a family of finite mixture models using every combination of the left-truncated lognormal, gamma, and weibull distributions.
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
)An ltmmCombo model object, with the following properties:
Copy of the input data
The selected distributions
List of all combinations of distributions considered
List of all ltmm fit objects
Vector of BIC values for each model
The best ltmm fit by BIC
The best BIC value of all fits
The combination of distributions used for the best fit by BIC
Vector of AIC value for each model
The best ltmm fit by AIC
The best AIC value of all fits
The combination of distributions used for the best fit by AIC
Vector of log-likelihood value for each model
Table summarizing the AIC, BIC, LL, and risk measures for each fitted model
data vector
number of components
densities to combine
left truncation point (optional)
initialization method for EM algorithm
number of random starts for initialization of EM algorithm. (only for G > 1)
initial parameter values (list of length G)
manually specified initial component proportions (for init_method=specified)
manually specified initial classes. will overwrite init_pars and init_pi
number of random starts for each numerical optimization in 1-component model
stopping tolerance for EM algoithm
maximum number of iterations of EM algorithm
print information as fitting progresses?
fit models in parallel?
number of processes used for parallel computation. if NULL detect.cores() used
save each model as it is produced, in a time-stamped directory (safer)
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.
# \donttest{
x <- secura$Loss
fits_GL <- ltmmCombo(x, G = 2, distributions = c('gamma', 'lognormal'), trunc = 1.2e6)
summary(fits_GL)
# }
Run the code above in your browser using DataLab