| search_lqmix | R Documentation |
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 = 200, verbose = TRUE,
seed = NULL, parallel = FALSE, ncores = 2)
formula |
an object of |
randomTC |
a one-sided formula of the form |
randomTV |
a one-sided formula of the form |
group |
a string indicating the grouping variable, i.e., the factor identifying the unit longitudinal measurements refer to |
time |
a string indicating the time variable |
Gv |
vector of possible number of mixture components associated to TC random coefficients, if present in the model |
mv |
vector of possible number of states associated to the TV random coefficients, if present in the model |
data |
a data frame containing the variables named in |
method |
method to use for selecting the optimal model. Possible values are |
nran |
number of repetitions of each random initialization |
qtl |
quantile to be estimated |
eps |
tolerance level for convergence of the EM algorithm |
maxit |
maximum number of iterations for the EM algorithm |
se |
standard error computation for the optimal model |
R |
number of bootstrap samples for computing standard errors |
verbose |
if set to FALSE, no printed output is given during the function execution |
seed |
an integer value for random numbers generation, used for random parameter initialization and bootstrap standard errors |
parallel |
if set to TRUE, a parallelized code is use for standard error computation (if |
ncores |
number of cores used for computing bootstrap standard errors (if required) |
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 starts is proportional to the number of mixture components and/or hidden states associated to the random coefficients in the model.
For models based on TC random coefficients, nran x (G-1) random starts are considered;
for models based on TV or TC and TV random coefficients, the number of random start is set to nran x (m-1) and nran x (G-1) x (m-1), respectively.
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.
Return an object of class search_lqmix. This is a list containing the following elements:
optimal |
the identified optimal model |
allmodels |
the output of each estimated model in the form of a list of lists; the former and the latter list are associated with TC and TV random coefficients, respectively |
lkv |
the vector of likelihood values for each fitted model |
aicv |
the vector of AIC values for each fitted model |
bicv |
the vector of BIC values for each fitted model |
qtl |
the estimated quantile |
mv |
the vector of possible number of states associated to TV random coefficients (if present) |
Gv |
the vector of possible number of mixture components associated to TC random coefficients (if present) |
method |
the method used to select the optimal model |
call |
the matched call |
sTC = search_lqmix(formula=meas~trt+time+trt:time,
randomTC=~1,group="id",time="time",Gv=1:3,method="bic",data=pain,se=FALSE)
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.