mtrem1.f file contains the code for MTREM(1).
It does not handle any missing cases. Therefore, you need to either impute them outside this code, 
or update this file to incorprate it.

In the working directory, prepare the following files:
y : the response vector
stcov1 : standardized covariate matrix for time 1
stcov2 : standardized covariate matrix for time 2
stcov3 : standardized covariate matrix for time 3
stcov4 : standardized covariate matrix for time 4

If you have less or more time points, please add/delete 'open' statements accordingly.

Once you execute, code will open up new files in the working directory, named, 
bp1j2.out : file containing random effect coefficients
tp1j2.out : file containing fixed effect coefficients
dp1j2.out : file with delta and deltastar values

According to your data, you will need to change the dimensions that are declared at the beginning of 
the file. In this particular example, there are N=100 subjects, NTIME=4 time points, and NJ=2 response
types. 

According to your data, you may also need to change the starting values of parameters, but more 
importantly the tunning parameters (these parameters are the ones that are set by EPS=..., EPSA=...). 
Due to the use of Hybrid MC, convergence is fast, so starting values probably will not be an issue. 
However, if tunning parameters are smaller than they should be, the convergence will not be observed. 
On the other hand, if they are larger than they should be, parameters may 'visit' unreasonable space, 
and an overflow problem might arise. Unfortunately, it takes 'trial-and-error' and patience to get the 
appropriate tunning parameters.

Due to intensive computation, it might be better not to run all e.g. 10,000 iterations at a time. 
Instead, it might be better to run paralel codes, and then combine the results. 
 

