1%feature("docstring") OT::KrawtchoukFactory 2"Krawtchouk specific orthonormal univariate polynomial family. 3 4For the :class:`~openturns.Binomial` distribution. 5 6Available constructors: 7 KrawtchoukFactory(*n=1, p=0.5*) 8 9Parameters 10---------- 11n : int, :math:`n > 0` 12 Number of experiment parameter of the :class:`~openturns.Binomial` 13 distribution. 14p : float, :math:`0 < p < 1` 15 Success probability parameter of the :class:`~openturns.Binomial` 16 distribution. 17 18Notes 19----- 20Any sequence of orthogonal polynomials has a recurrence formula relating any 21three consecutive polynomials as follows: 22 23.. math:: 24 25 P_{i + 1} = (a_i x + b_i) P_i + c_i P_{i - 1}, \quad 1 < i < n 26 27The recurrence coefficients for the Krawtchouk polynomials come analytically 28and read: 29 30.. math:: 31 32 \begin{array}{rcl} 33 a_i & = & \displaystyle - \frac{1} 34 {\sqrt{(i + 1) (n - i) p (1 - p)}} \\ 35 b_i & = & \displaystyle \frac{p (n - i) + i (1 - p)} 36 {\sqrt{(i + 1) (n - i) p (1 - p)}} \\ 37 c_i & = & \displaystyle - \sqrt{(1 - \frac{1}{i + 1}) 38 (1 + \frac{1}{n - i})} 39 \end{array}, \quad 1 < i 40 41where :math:`n` and :math:`p` are the parameters of the 42:class:`~openturns.Binomial` distribution. 43 44.. warning:: 45 46 The Krawtchouk polynomials are only defined up to a degree :math:`m` equal 47 to :math:`n - 1`. Indeed, for :math:`i = n`, some factors in the 48 denominators of the recurrence coefficients would be equal to zero. 49 50See also 51-------- 52StandardDistributionPolynomialFactory 53 54Examples 55-------- 56>>> import openturns as ot 57>>> polynomial_factory = ot.KrawtchoukFactory(3, 0.5) 58>>> for i in range(3): 59... print(polynomial_factory.build(i)) 601 61-1.73205 + 1.1547 * X 621.73205 - 3.4641 * X + 1.1547 * X^2" 63 64// --------------------------------------------------------------------- 65 66%feature("docstring") OT::MeixnerFactory::getN 67"Accessor to the number of failures parameter :math:`n`. 68 69Of the :class:`~openturns.Binomial` distribution. 70 71Returns 72------- 73n : int 74 Number of experiments parameter of the :class:`~openturns.Binomial` 75 distribution." 76 77// --------------------------------------------------------------------- 78 79%feature("docstring") OT::MeixnerFactory::getP 80"Accessor to the success probability parameter :math:`p`. 81 82Of the :class:`~openturns.Binomial` distribution. 83 84Returns 85------- 86p : float 87 Success probability parameter of the :class:`~openturns.Binomial` 88 distribution." 89