                 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;
         }

    int diag_index = 0;
    for (int j=0; j<dim_theta; j++) {
    	// Initialize the covariance matrix of the theta proposal distribution to be 0.01 * identity(p)
        theta_cholfactor[j] = 1e-2;
        diag_index += j + 2;
    }


    thrust::host_vector<double> h_true_chi(ndata * p);

    // Generate characteristics and data
    std::cout << "Generating some data..." << std::endl;
    generate_data(ndata, h_theta, h_true_chi, h_meas, h_meas_unc);

