     //std::ofstream chifile("chis.dat");
     std::ofstream thetafile("thetas.dat");
     
-    int mcmc_iter = 10;
+    int mcmc_iter = 2;
     int naccept_theta = 0;
     std::cout << "Running MCMC Sampler...." << std::endl;
     
     thrust::host_vector<double> h_mha_ratios(n);
     thrust::device_vector<double> d_mha_ratios(n);
+    thrust::host_vector<double> h_logdens;
     
     for (int i=0; i<mcmc_iter; i++) {
         // Now grab the pointers to the vectors, needed to run the kernel since it doesn't understand Thrust

    double logdensity = 0.0;
    for (int j=0; j<dim_chi; j++) {
        double mu_j = theta[j];
        double var_j = exp(theta[j + ntheta]);
        double centered_chi_j = chi[j] - mu_j;
        logdensity += -0.5 * log(var_j) - 0.5 * centered_chi_j * centered_chi_j / var_j;
    }
    return logdensity;

	}
}

struct zsqr : public thrust::unary_function<double,double> {
    double mu, var;
    zsqr(double m, double v) : mu(m), var(v) {}
    
    __device__ __host__
    double operator()(double chi) {
        double chi_cent = chi - mu;
        double logdens_pop = -0.5 * log(var) - 0.5 * chi_cent * chi_cent / var;
        return logdens_pop;
    }
};

