-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Setting limits of integration in solve to avoid new QuadratureProblem #81
Comments
The Julia compiler will optimize out immutable constructions in local instances, so |
Ah thanks!! I didn't know about the Regarding the second point about heap vs. stack, we're only solving one-dimensional integrals (we just happen to have a lot of them) of fairly well-behaved functions. Based on some small trial timings, it seemed like using GuadGKJL() would probably be the most performant algorithm, but I couldn't figure out how to do the integration in-place. Interestingly, the non-in-place version seems to outperform the in-place version when I use the HCubatureJL() backend. Maybe I'm doing something wrong? Code for timings:
|
@YingboMa check this when you look at the stability stuff. |
See #65 (comment) we cannot really make the current API fast because it's inherently expensive. |
Hi @ChrisRackauckas, I am reopening this to ask whether it is possible to use
Thanks |
Remake won't handle that well. We're working on an enhanced parameter interface to solve this kind of thing, SciML/DifferentialEquations.jl#881 |
Thanks! I'll stay tuned, closing this issue now. |
Hello,
Is there a way to specify the limits of integration in the
solve()
call instead of when I create a new QuadratureProblem? The problem I am solving involves repeatedly integrating the same function, but over different intervals that are not necessarily known at compile time. I would like to avoid having to create a new instance of QuadratureProblem every time I get a new set of intervals. The context for this is a package for Bayesian inference for time to event models where sample paths are sampled as part of the MCMC algorithm (the limits of integration change at each step of the Markov chain) and the likelihood depends on the integrated hazard over each inter-event interval.Looking at the source code, it seems like perhaps something like this is possible since one of the signatures for solve is:
solve(prob::QuadratureProblem, ::Nothing, sensealg, lb, ub, p, args...; reltol, abstol, kwargs...) in Quadrature at /Users/fintzijr/.julia/packages/Quadrature/UCzIP/src/Quadrature.jl:139
However, I'm not entirely sure how to initialize a QuadratureProblem and solve it using this signature.For example, how should I modify the following?
I've also tried extending Quadrature to define a QuadratureProblem that is a mutable struct so that I could modify
qp.lb
andqp.ub
directly. I'm sure that there are very good reasons why instances of QuadratureProblem are immutable, so this is probably a very silly thing to do for other reasons and maybe it's good that it didn't work.Thank you!
The text was updated successfully, but these errors were encountered: