Search the global maximum of the log-likelihood function for a finite mixture of linear quantile regression models with TC and/or TV, discrete, random coefficients, for varying number of components and/or states
search_lqmix(formula, randomTC = NULL, randomTV = NULL, group, time,
Gv = NULL, mv = NULL, data, method = "bic", nran = 0, qtl = 0.5,
eps = 10^-5, maxit = 1000, se = TRUE, R = 50, verbose = TRUE,
posterior = FALSE, seed = NULL, parallel = FALSE)
Return an object of class
search_lqmix
. This is a list containing the following elements:
the identified optimal model
the output of each estimated model
the vector of likelihood values for each estimated model
the vector of AIC values for each estimated model
the vector of BIC values for each estimated model
the estimated quantile
the vector of possible number of states associated to TV random coefficients (if present)
the vector of possible number of mixture components associated to TC random coefficients (if present)
the method used to select the optimal model
the matched call
an object of class
formula
: a symbolic description of the model to be fitted
a one-sided formula of the form ~z1+z2+...+zr
, where z1,..., zr
denote the variables associated to TC random coefficients (1 for the intercept)
a one-sided formula of the form ~w1+w2+...+wl
, where w1,..., wl
denote the variables associated to TV random coefficients (1 for the intercept). Note that only TC variables are allowed
a string indicating the grouping variable, i.e., the factor identifying the unit longitudinal measurements refer to
a string indicating the time variable
vector of possible number of mixture components associated to TC random coefficients (if present)
vector of possible number of states associated to the TV random coefficients (if present)
a data frame containing the variables named in formula
, randomTC
, randomTV
, and time
method to use for selecting the optimal model. Possible values are "lk"
, "aic"
, or "bic"
number of repetitions of each random initialization
quantile to be estimated
tolerance level for (relative) convergence of the EM algorithm
maximum number of iterations for the EM algorithm
standard error computation for the optimal model
number of bootstrap samples for computing standard errors
if set to FALSE, no printed output is given during the function execution
if set to TRUE, posterior probabilities are given in output
an integer value for random numbers generation
if set to TRUE, a parallelized code is use for standard error computation (if se=TRUE)
The function allows to identify the optimal model specification in terms of number of mixture components and/or hidden states associated to TC and/or TV random coefficients, respectively. This is done by considering a multi-start strategy based on both deterministic and random starting points. The number or random tries is proportional to the number of mixture components and/or hidden states associated to the random coefficients in the model.
If method="lk"
, the optimal model selected by the function is that providing the highest log-likelihood value;
if method="AIC"
, (method="BIC"
, respectively), the optimal model selected by the function is that providing the lowest AIC (BIC, respectively) value.
If se=TRUE
, standard errors based on a block bootstrap procedure are computed for the identified optimal model.
sTC = search_lqmix(formula=meas~trt+time+trt:time,
randomTC=~1,group="id",time="time",Gv=1:3,method="bic",data=pain,se=FALSE)
# \donttest{
sTV = search_lqmix(formula=meas~trt+time+trt:time,
randomTV=~1,group="id",time="time",mv=1:3,method="bic",data=pain,se=FALSE)
sTCTV = search_lqmix(formula=meas~trt+time+trt:time,
randomTC=~time,randomTV=~1,group="id",time="time",mv=1:3,Gv=1:3,method="bic",data=pain,se=FALSE)
# }
Run the code above in your browser using DataLab