Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve reporting of failed multipole integrals #12

Open
dkirkby opened this issue Feb 21, 2014 · 2 comments
Open

Improve reporting of failed multipole integrals #12

dkirkby opened this issue Feb 21, 2014 · 2 comments

Comments

@dkirkby
Copy link
Collaborator

dkirkby commented Feb 21, 2014

A k-space model can fail if the 1D k-space multipole integral fails. Nicolas has seen an example of this in a chisq scan. Currently this integral is done using integrateSmooth in cosmo/TransferFunctionPowerSpectrum.cc:

double local::getMultipole(likely::GenericFunctionPtr fOfMuPtr, int ell, double epsAbs, double epsRel) {
    MultipoleIntegrand multipoleIntegrand(fOfMuPtr,ell);
    likely::Integrator::IntegrandPtr integrand(new likely::Integrator::Integrand(
        boost::ref(multipoleIntegrand)));
    likely::Integrator integrator(integrand,epsAbs,epsRel);
    // Factor of two is because we integrate over 0 < mu < 1 instead of -1 < mu < +1.
    return 2*integrator.integrateSmooth(0,1);
}

Should catch the resulting cosmo::RuntimeError and give a more useful error message.

dkirkby added a commit that referenced this issue Feb 27, 2014
@dkirkby
Copy link
Collaborator Author

dkirkby commented Feb 27, 2014

Catch any std::runtime_error when fitting for a scan-point and keep going (saving the initial best-fit parameter values updated for this scan point and a chisq value of zero).

A better solution might be to make the getMultipole integrator more robust. To be revisited if this continues to be a problem (after applying reasonable priors on beta, etc).

@dkirkby dkirkby closed this as completed Feb 27, 2014
@dkirkby
Copy link
Collaborator Author

dkirkby commented Feb 27, 2014

TODO: Print number of failed fits at the end of the scan.

@dkirkby dkirkby reopened this Feb 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant