-
-
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
Add cumulative
kwarg for solving SampledIntegralProblem
#182
base: master
Are you sure you want to change the base?
Add cumulative
kwarg for solving SampledIntegralProblem
#182
Conversation
solving `SampledIntegralProblem`
@ChrisRackauckas can you review this? |
I guess it's fine but why should this be done in the solver? What is this doing that cumsum after the solver does not? |
So, the aim is to get back an integrated time series back from a time series. Basically collecting intermediate results. |
src/common.jl
Outdated
@@ -114,10 +115,10 @@ function Base.setproperty!(cache::SampledIntegralCache, name::Symbol, x) | |||
end | |||
|
|||
function SciMLBase.init(prob::SampledIntegralProblem, | |||
alg::SciMLBase.AbstractIntegralAlgorithm; | |||
alg::SciMLBase.AbstractIntegralAlgorithm; cumulative = false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that breaks type-stability, it needs to be type level information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so, we should do cumulative::Bool = false
to make it type stable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it would need to be a value type, Val(false)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, addressed in 46a11e1
@sathvikbhagavan I read the pr and I'm not sure this actually does what I would expect. Do you actually need the accuracy of a quadrature rule, or would My perspective is that if new quadrature schemes are added for which all the weights change when a single data point is added, then cumulative integrals are equivalent to doing a sampled integral problem for each sub-sequence. If my data represents a time series and I want the best estimate to the integral at each time step, I would solve a sampled integral problem for each sub-sequence of the data, e.g. for all For example, consider the difference between |
@sathvikbhagavan It has been 6 months since you opened this pr so I was wondering if you still need it? With #222 I'm skeptical that using the partial sums is equivalent to computing the integral of the time series |
No description provided.