///////////////////////////////////////////////////////////////////////////////////////////
NOTE: 
--This code is not the final version used to generate the results. 
--It has the needed components used in the algorithm. 
--Please be aware there are some minor problems inside. 
--The code is just for a reference and intended for those who would like to play with 
and implement the method by themselves.   
//////////////////////////////////////////////////////////////////////////////////////////

Descriptions of files

auxfun.c - auxiliary c code
linalg.c - linear algebra c code
lasso.c - c code which performs lasso, mle, lqa, lla algorithms
arms.c -  c code of Wilks performs ARMS
lmeq.c - c code of GLMM and LMM
lmeqpl.c - c code to peform MLE, LQA, and LLA of GLMM and LMM
lmeqsim.c - c code to simulate from random effects in GLMM and LMM

missing.r, lme_auxfun.r, auxiliary r functions
penaltyfunctions.r, functions and densities of penalty functions
pl.r, perform individuals and conditional maximization of functions i.e. ECM alg of Meng and Rubin
lmeq.r, clacs gradients of q function and next iterate functions of NR, LQA, and LLA algs
lmeqpl.r performs MPL estimation and computes ICQ and RE penalty estimates

yaleinfant.txt is yale data
yaleinfant.r performs analysis of yale growth data

To compile (form unix/linux)
1. First install the packages: MASS, nlme, lmm, HI, epicalc and any other packages which are needed by my code.
2. Compile/Dynamically load the file lmeqpl.c. and make sure its loaded properly.
This is done differently depending on the system one is using. For instance, on the emerald UNC cluster, to dynamically load a file I:
i. remove all files lmeqpl.o, lmeqpl.so, and lmeqpl.dll 
ii. then I typed R CMD SHLIB which should create a file lmeqpl.so
ii. amended lmeqfit.r so that the lmeqpl.so is dynamically loaded using the command dyn.load("lmeqpl.so")
3. type source("yaleinfant.r"), 

this should produce rdata files with the names yaleout*.rdata with * depending on what penalty function one wants which is controled by the variable pf
To do 3. in the command prompt on the emerald cluster type bsub R CM BATCH -pf=* yaleinfant.r yaleinfant.out, with *=1,2,or3
