diff --git a/src/maxent_params.cpp b/src/maxent_params.cpp index 1a4b77b..bc501f4 100644 --- a/src/maxent_params.cpp +++ b/src/maxent_params.cpp @@ -238,9 +238,11 @@ void ContiParameters::decompose_covariance_matrix(const alps::params& p){ // We drop eigenvalues of the covariance matrix which are smaller than 1e-10 // as they represent bad data directions (usually there is a steep drop // below that value) + double cutoff = p["CM_EIGENVALUE_CUTOFF"]; + std::cout << "Cutoff for singular eigenvalues of the covariance: " << cutoff << "\n"; int new_ndat_,old_ndat_=ndat(); for (new_ndat_ =0;new_ndat_1e-10) break; + if (var[new_ndat_]>cutoff) break; // This is the number of good data ndat_ = old_ndat_ - new_ndat_; if (new_ndat_ ==0) @@ -259,7 +261,7 @@ void ContiParameters::decompose_covariance_matrix(const alps::params& p){ } } for (int i=0; i(p["NORM"]); + sigma_[i] = std::sqrt(std::abs(var(new_ndat_+i)))/static_cast(p["NORM"]); if (p["VERBOSE"]) std::cout << "# " << var(new_ndat_+i) << "\n"; } diff --git a/src/maxent_simulation.cpp b/src/maxent_simulation.cpp index 8aab2dd..a5541b4 100644 --- a/src/maxent_simulation.cpp +++ b/src/maxent_simulation.cpp @@ -57,6 +57,7 @@ void MaxEntSimulation::define_parameters(alps::params &p){ p.define("NDAT","# of input points"); p.define("DATA","","data file input"); p.define("COVARIANCE_MATRIX","","name of covariance matrix file"); + p.define("CM_EIGENVALUE_CUTOFF",1e-10, "Cutoff for eigenvalues of the covariance matrix"); p.define("BASENAME","","Specified output name (generated if not given)"); p.define("MODEL_RUNS","How many default model runs"); p.define("X_0","G input for param file entry"); @@ -309,15 +310,20 @@ void MaxEntSimulation::evaluate(){ // for the self energy: use Im Sigma(omega)=-A(omega)*pi ofstream_ maxspec_self_str;maxspec_self_str.open((name+"maxspec_self.dat").c_str()); ofstream_ avspec_self_str; avspec_self_str.open((name+"avspec_self.dat").c_str()); + ofstream_ chispec_self_str; chispec_self_str.open((name+"chispec_self.dat").c_str()); for (std::size_t i=0; i