/* GALINEX.C: A computer program for running some of the simulations in the chapter "Optimal Proposal Distributions and Adaptive MCMC", by J.S. Rosenthal, available from: http://probability.ca/jeff/research.html Copyright (c) 2008 by Jeffrey S. Rosenthal. Licensed for general copying, distribution and modification according to the GNU General Public License (http://www.gnu.org/copyleft/gpl.html). */ #define TARGSCALING true #define N 10 #define sigma 0.7 #define numreps 100000 #include #include #include #include #define PI 3.1415926536 double M[N][N], Sigmainv[N][N]; main() { int i,j,k,n; double x[N], y[N], normvec[N], sq(), normal(), logpi(), h(); int numacc; double hsum; #ifdef TARGSCALING printf("Yes targscaling ... sigma=%f\n", sigma); #else printf("No targscaling ... sigma=%f\n", sigma); #endif /* Define the matrix M. */ printf("M =\n"); for (i=0; i