                 chi[n * j + i] = new_chi[j];
             }
             logdens_pop[i] = logdens_pop_prop;
+            logdens_meas[i] = logdens_meas_prop;
             ++naccept[i];
         }
 

		*/

        // Update the theta values

        /*
        thrust::device_vector<double>::iterator chi_iter_begin = d_chi.begin();

        double logdens_pop = 0.0;
        for (int j=0; j<dim_theta/2; j++) {
            double proposed_mu_j = proposed_theta[j];
            double proposed_var_j = exp(proposed_theta[j + p]);
            // transform and reduction is over d_chi[j * n : (j+1) * n - 1]
            zsqr zsqrj(proposed_mu_j, proposed_var_j);
            logdens_pop = thrust::transform_reduce(chi_iter_begin, chi_iter_begin+ndata,
                                                zsqrj, logdens_pop, thrust::plus<double>());
            thrust::advance(chi_iter_begin, ndata);
        }
        */

        // get log-density of current value of theta
        double logdens_old = thrust::reduce(d_logdens_pop.begin(), d_logdens_pop.end());

                scaled_proposal_j += cholfactor[cholfact_index] * snorm_deviate[k];
                cholfact_index++;
            }
            // scaled_proposal_j = 0.0;
            new_chi[j] = chi[n * j + i] + scaled_proposal_j;
            scaled_proposal[j] = scaled_proposal_j;
        }
