search_lqmix {lqmix}R Documentation

Search the Global Maximum of a Linear Quantile Mixture

Description

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

Usage

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,
  seed = NULL, parallel = FALSE)

Arguments

formula

an object of class formula: a symbolic description of the model to be fitted

randomTC

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)

randomTV

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

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)

mv

vector of possible number of states associated to the TV random coefficients (if present)

data

a data frame containing the variables named in formula, randomTC, randomTV, and time

method

method to use for selecting the optimal model. Possible values are "lk", "aic", or "bic"

nran

number of repetitions of each random initialization

qtl

quantile to be estimated

eps

tolerance level for (relative) 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

parallel

if set to TRUE, a parallelized code is use for standard error computation (if se=TRUE)

Details

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.

Value

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

lkv

the vector of likelihood values for each estimated model

aicv

the vector of AIC values for each estimated model

bicv

the vector of BIC values for each estimated 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

Examples

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)


[Package lqmix version 1.0 Index]