GENERAL USAGE NOTES
===========================


(1) Generating Data for the Samplers
=====================================

There are two files that control the data generation process for the samplers.

	(1) ExperimentSim.m - This file generates a sample file for each MCMC run. 

		The main parameters to be set are:
			Nsamples - number of samples (same as number of MCMC runs we want to do)
			xGen - which controls X matrix generation (deteministic, random and uncorrelated, correlated (band matrix) )
			trueGraphType - which controls the true graph types (decomposable (clique of size 10), random tree, basic non-decomposable (loop), erdos-renyi (more non-decomposable) )
			csim - vector of Nsamples signal to noise ratio parameter for a run 

		The output is a simulated data mat file numbered with an id ranging from 001 to number of samples (e.g. Data/Clique/RandomUncorrelated/simulatedData-019.mat)
			The file contains:
				Y - the simulated output
				X - the input
				truegraph - adjacency matrix of the true graph 
				trueind - the vector of true indicator ids
				csim - the signal to noise ratio parameter used to generate the data
				nB - matrix 2-norm of B 
				nE - matrix 2-norm of E

	(2) simdata.m - contains the function that actually simulates the data

		The main issue here is if the graph is non-decomposable, many covariance matrices are generated and the first positive definite matrix whose inverse corresponds to a non-decomposable graph is selected.
		This is done for numerical reasons of the HIW sampler.


(2) Running the MCMC Sampler
=============================

There are two files that control an MCMC run: 

	(1) RunLocalSim.m - which gets the data and the parameters from the data and loads them into the sampler

		The main parameters to be set are: 
		 
		 burnin - number of burnin to use
		 nmc - number of mcmc iterations to use
		 integratedSampler - Parameter that controls the graph method 
		 	integratedSampler = 0 means that the MCMC sampler will use decomposable search
		 	integratedSampler = 1 means that the MCMC sampler will integrate out the structure and only sample indicator vectors


		 The following parameters just set directory and filename structure so that the data are loaded separately in different simulation settings and are not directly related to MCMC run parameters

		 sampleID - allows to load data corresponding to different runs and store results corresponding to the run 
		 xGen - an indicator as to which X generation method was used. (mainly used to tell the sampler where the data is and where to store results)
		 trueGraphType - an indicator as to which true graph type was used ( again mainly for loading data and storing results)
    
    (2) SSUR_swap.m - actual script to run the MCMC sampler


    	The sampler outputs a result file in the directory structure indicated by xGen, trueGraphType, and integratedSampler (e.g. SimResults/Clique/RandomUncorrelated/Decomp vs SimResults/Clique/RandomUncorrelated/IntegratedSampler for the different graph methods)
    	
    	In the output file:
    	====================

    		sampledVars - an (nmc+burnin) X p matrix which stores the variables selected in each step. 
    		z1_save - running averages of the indicators selected
    		ll - likelihood values for the run

    		decomposable search only:
    		========================	
    			adj_save - running average of the edges selected
    			sampledGraphs - an (nmc + burnin) cell array which stores the adjacency matrices for each step of the mcmc.


    	Any other parameters in this file have not been altered since the original code was uploaded 