ltmmCombo | R Documentation |
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
)
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) |
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
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.
x <- secura$Loss
fits_GL <- ltmmCombo(x, G = 2, distributions = c('gamma', 'lognormal'), trunc = 1.2e6)
summary(fits_GL)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.