alashworth / test-issue-import

0 stars 0 forks source link

add one-dimensional integator #181

Open alashworth opened 5 years ago

alashworth commented 5 years ago

Issue by bob-carpenter Wednesday Feb 07, 2018 at 21:47 GMT Originally opened as https://github.com/stan-dev/stan/issues/2466


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: https://github.com/stan-dev/math/pull/566

Description

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

Current Version:

v2.17.1

alashworth commented 5 years ago

Comment by aornugent Monday Jan 14, 2019 at 07:43 GMT


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