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

add one-dimensional integator #2466

Closed
bob-carpenter opened this issue Feb 7, 2018 · 8 comments
Closed

add one-dimensional integator #2466

bob-carpenter opened this issue Feb 7, 2018 · 8 comments

Comments

@bob-carpenter
Copy link
Contributor

bob-carpenter commented Feb 7, 2018

Summary:

Expose one dimensional integrator function from the math library to the language.

/**
 * Return definite integral of specified function between lower bound and upper
 * bound, with specified absolute and relative tolerances.
 * @param f one-dimensional function to integrate
 * @param lb lower bound of integration
 * @param ub upper bound of integration
 * @param theta vector of parameters
 * @param atol absolute tolerance of solution
 * @param rtol relative tolerance of solution
 * @return integral of f between lb and ub
 * @throw if lb, ub, atol, rtol are not finite or if atol and rtol are not positive or if lb > ub
 */
real integrate_definite(fun(real -> real) f, real lb, real ub, vector theta, real atol, real rtol);

The function f must have the signature

real f(real y, vector theta)

and what gets returned is

INTEGRAL_lb^ub  f(y, theta) d.y

See: stan-dev/math#566

Description

This will require a special expression as it takes a function as input.

Current Version:

v2.17.1

@aornugent
Copy link

Sorry to pester -is this far from making into the language? Ben's doc looks good.

@seantalts
Copy link
Member

Was this fixed by #2627?

@bob-carpenter
Copy link
Contributor Author

bob-carpenter commented Sep 23, 2019 via email

@seantalts
Copy link
Member

I've also seen branches reference issues they didn't intend to fully close before too. I think it's a lot easier if the PR just says "Fixes #2466" on it. That syntax is supported by GitHub and will automatically link and close the referenced issue.

@bob-carpenter
Copy link
Contributor Author

bob-carpenter commented Sep 23, 2019 via email

@seantalts
Copy link
Member

seantalts commented Sep 23, 2019 via email

@bob-carpenter
Copy link
Contributor Author

bob-carpenter commented Sep 23, 2019 via email

@mcol
Copy link
Contributor

mcol commented Jan 12, 2020

Fixed by #2627.

@mcol mcol closed this as completed Jan 12, 2020
@mcol mcol added this to the 2.19.0 milestone Jan 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants