         double* p_chi = thrust::raw_pointer_cast(&d_chi[0]);
         double* p_prop_cholfact = thrust::raw_pointer_cast(&d_prop_cholfact[0]);
         double* p_logdens = thrust::raw_pointer_cast(&d_logdens[0]);
+        double* p_mha_ratio = thrust::raw_pointer_cast(&d_mha_ratios[0]);
         int current_iter = i + 1;
-        update_chi<<<nBlocks,nThreads>>>(p_chi, p_meas, p_meas_unc, n, p_logdens, p_prop_cholfact, devStates, current_iter);
+        update_chi<<<nBlocks,nThreads>>>(p_chi, p_meas, p_meas_unc, n, p_logdens, p_prop_cholfact, devStates, current_iter, p_mha_ratio);
         
         // Generate new theta in parallel with GPU calculation above
         thrust::host_vector<double> proposed_theta(dim_theta);

        double ratio = exp(lograt);
        double unif = uniform(rng);
        
        if (unif < ratio) {
            // Accept the proposed theta
            h_theta = proposed_theta;

        double logdens_prop = logdens_meas + logdens_pop;
        
        // Compute the Metropolis ratio
        double ratio = logdens_prop - logdens[i] - logdens_meas;
        ratio = (ratio < 0.0) ? ratio : 0.0;
        ratio = exp(ratio);
        
        p_mha_ratio[i] = ratio;
        
        // Now randomly decide whether to accept or reject
        double unif_draw = curand_uniform_double(&localState);
