# The code should be run as:
# nsgp data_dir num_files num_train num_test num_covariates num_burnin num_iterations stationarity storage_interval write_interval

# an example run would be:
nsgp_binom dat/dgk1 1 101 0 1 5000 20000 nonstat 20 100 

# arguments are: 
# data_dir: directory with data files
# num_files: the number indexing files to be used -- e.g. if this value is 3, then the covariate file is  x3.dat, observation file  is y3.dat, function values file is fun3.dat, initial values file is init3.dat, permutation file is perm3.dat, and parameter settings file is parm3.dat
# num_train: number of training observations
# num_test: number of test observations
# num_covariates: number of covariates
# num_burnin: number of burn-in iterations
# num_iterations: number of non-burn-in iterations
# stationarity: `stat' or `nonstat' to indicate whether stationary or nonstationary GP prior is to be used
# storage_interval: interval between stored iterates; 0 if no iterates should be written
# write_interval: number of iterates to store before writing to output files 

# the files needed to run the model are as follows:
# let N be the num_files argument
# xN.dat should contain the covariate values, with as num_covariates columns and num_train+num_test rows, with training points first.  The covariates should be space delimited in each row
# yN.dat should contain num_train rows, with one observation per row, the first column the number of trials and the second column the number of successes
# funN.dat should contain num_train+num_test rows, with training points first, and either the true function value (for simulated data) or the observation (for real data), one per row
# initN.dat should contain the initialization values - see examples init1d.dat, init2d.dat and init3d.dat for 1,2,and 3 dimensional covariate examples
# parmN.dat should contain the prior and proposal information for the parameters - see examples parm1d.dat, parm2d.dat and parm3d.dat for 1,2,and 3 dimensional covariate examples
# permN.dat should contain num_train+num_test rows, with the training set permutation in the first num_train rows and the test set in the remaining rows. For example if there were 3 training points and 2 test points, the permutation might be 2 1 3 5 4, with each value in its own row, indicating to permute the 3 training points by taking the second one as the first, the first as the second, etc. 

