Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ hypergeometric_3F2() [1/2]

template<typename Ta , typename Tb , typename Tz , require_all_vector_t< Ta, Tb > * = nullptr, require_stan_scalar_t< Tz > * = nullptr>
auto stan::math::hypergeometric_3F2 ( const Ta &  a,
const Tb &  b,
const Tz &  z 
)
inline

Hypergeometric function (3F2).

Function reference: http://dlmf.nist.gov/16.2

\[ _3F_2 \left( \begin{matrix}a_1 a_2 a[2] \\ b_1 b_2\end{matrix}; z \right) = \sum_k=0^\infty \frac{(a_1)_k(a_2)_k(a_3)_k}{(b_1)_k(b_2)_k}\frac{z^k}{k!} \]

Where _k$ is an upper shifted factorial.

Calculate the hypergeometric function (3F2) as the power series directly to within precision or until max_steps terms.

This function does not have a closed form but will converge if:

  • |z| is less than 1
  • |z| is equal to one and b[0] + b[1] < a[0] + a[1] + a[2] This function is a rational polynomial if
  • a[0], a[1], or a[2] is a non-positive integer This function can be treated as a rational polynomial if
  • b[0] or b[1] is a non-positive integer and the series is terminated prior to the final term.
Template Parameters
Tatype of Eigen/Std vector 'a' arguments
Tbtype of Eigen/Std vector 'b' arguments
Tztype of z argument
Parameters
[in]aAlways called with a[1] > 1, a[2] <= 0
[in]bAlways called with int b[0] < |a[2]|, <= 1)
[in]zz (is always called with 1 from beta binomial cdfs)
[in]precisionprecision of the infinite sum. defaults to 1e-6
[in]max_stepsnumber of steps to take. defaults to 1e5
Returns
The 3F2 generalized hypergeometric function applied to the arguments {a1, a2, a3}, {b1, b2}

Definition at line 116 of file hypergeometric_3F2.hpp.