# HistogramPolynomialFactory¶ class HistogramPolynomialFactory(*args)

Histogram specific orthonormal univariate polynomial family.

For the Histogram distribution.

Available constructor:

HistogramPolynomialFactory(first, width, height)

Parameters
firstfloat

Lower bound.

widthpositive sequence of float is the width of the class .

heightpositive sequence of float is the frequency of the class .

Notes

Any sequence of orthogonal polynomials has a recurrence formula relating any three consecutive polynomials as follows: The recurrence coefficients for the HistogramPolynomial polynomials are computed from the recurrence of the associated monic polynomials (see AdaptiveStieltjesAlgorithm) but with an exact evaluation of the dot-products.

Examples

>>> import openturns as ot
>>> polynomial_factory = ot.HistogramPolynomialFactory(1.0, [1.0, 2.0], [4.0, 2.0])
>>> for i in range(3):
...     print(polynomial_factory.build(i))
1
-2.56273 + 1.13899 * X
7.80593 - 7.42767 * X + 1.5268 * X^2


Methods

 build(self, degree) Build the -th order orthogonal univariate polynomial. buildCoefficients(self, degree) Build the -th order orthogonal univariate polynomial coefficients. Build the recurrence coefficients. getClassName(self) Accessor to the object’s name. getId(self) Accessor to the object’s id. getMeasure(self) Accessor to the associated probability measure. getName(self) Accessor to the object’s name. getNodesAndWeights(self, n) Build the -th order quadrature scheme. getRecurrenceCoefficients(self, n) Accessor to the recurrence coefficients of the -th order. getRoots(self, n) Accessor to the recurrence coefficients of the -th order. getShadowedId(self) Accessor to the object’s shadowed id. getVisibility(self) Accessor to the object’s visibility state. hasName(self) Test if the object is named. hasVisibleName(self) Test if the object has a distinguishable name. setName(self, name) Accessor to the object’s name. setShadowedId(self, id) Accessor to the object’s shadowed id. setVisibility(self, visible) Accessor to the object’s visibility state.
 getFirst getHeight getWidth
__init__(self, \*args)

Initialize self. See help(type(self)) for accurate signature.

build(self, degree)

Build the -th order orthogonal univariate polynomial.

Parameters
kint, Polynomial order.

Returns
polynomialOrthogonalUniVariatePolynomial

Requested orthogonal univariate polynomial.

Examples

>>> import openturns as ot
>>> polynomial_factory = ot.HermiteFactory()
>>> print(polynomial_factory.build(2))
-0.707107 + 0.707107 * X^2

buildCoefficients(self, degree)

Build the -th order orthogonal univariate polynomial coefficients.

Parameters
kint, Polynomial order.

Returns
coefficientsPoint

Coefficients of the requested orthogonal univariate polynomial.

Examples

>>> import openturns as ot
>>> polynomial_factory = ot.HermiteFactory()
>>> print(polynomial_factory.buildCoefficients(2))
[-0.707107,0,0.707107]

buildRecurrenceCoefficientsCollection(self, degree)

Build the recurrence coefficients.

Build the recurrence coefficients of the orthogonal univariate polynomial family up to the -th order.

Parameters
kint, Polynomial order.

Returns
recurrence_coefficientslist of Point

All the tecurrence coefficients up to the requested order.

Examples

>>> import openturns as ot
>>> polynomial_factory = ot.HermiteFactory()
>>> print(polynomial_factory.buildRecurrenceCoefficientsCollection(2))
[[1,0,0],[0.707107,0,-0.707107]]

getClassName(self)

Accessor to the object’s name.

Returns
class_namestr

The object class name (object.__class__.__name__).

getId(self)

Accessor to the object’s id.

Returns
idint

Internal unique identifier.

getMeasure(self)

Accessor to the associated probability measure.

Returns
measureDistribution

The associated probability measure (according to which the polynomials are orthogonal).

Notes

Two polynomials P and Q are orthogonal with respect to the probability measure if and only if their dot product: where and .

Examples

>>> import openturns as ot
>>> polynomial_factory = ot.HermiteFactory()
>>> print(polynomial_factory.getMeasure())
Normal(mu = 0, sigma = 1)

getName(self)

Accessor to the object’s name.

Returns
namestr

The name of the object.

getNodesAndWeights(self, n)

Build the -th order quadrature scheme.

Associated with the orthogonal univariate polynomials family.

Parameters
kint, Polynomial order.

Returns
nodesPoint

The nodes of the -th order quadrature scheme.

weightsPoint

The weights of the -th order quadrature scheme.

Examples

>>> import openturns as ot
>>> polynomial_factory = ot.HermiteFactory()
>>> nodes, weights = polynomial_factory.getNodesAndWeights(3)
>>> print(nodes)
[-1.73205,...,1.73205]
>>> print(weights)
[0.166667,0.666667,0.166667]

getRecurrenceCoefficients(self, n)

Accessor to the recurrence coefficients of the -th order.

Of the orthogonal univariate polynomial.

Parameters
kint, Polynomial order.

Returns
recurrence_coefficientsPoint

The recurrence coefficients of the -th order orthogonal univariate polynomial.

Notes

Any sequence of orthogonal polynomials has a recurrence formula relating any three consecutive polynomials as follows: Examples

>>> import openturns as ot
>>> polynomial_factory = ot.HermiteFactory()
>>> print(polynomial_factory.getRecurrenceCoefficients(3))
[0.5,0,-0.866025]

getRoots(self, n)

Accessor to the recurrence coefficients of the -th order.

Of the orthogonal univariate polynomial.

Parameters
kint, Polynomial order.

Returns
rootsPoint

The roots of the -th order orthogonal univariate polynomial.

Examples

>>> import openturns as ot
>>> polynomial_factory = ot.HermiteFactory()
>>> print(polynomial_factory.getRoots(3))
[-1.73205,...,1.73205]

getShadowedId(self)

Accessor to the object’s shadowed id.

Returns
idint

Internal unique identifier.

getVisibility(self)

Accessor to the object’s visibility state.

Returns
visiblebool

Visibility flag.

hasName(self)

Test if the object is named.

Returns
hasNamebool

True if the name is not empty.

hasVisibleName(self)

Test if the object has a distinguishable name.

Returns
hasVisibleNamebool

True if the name is not empty and not the default one.

setName(self, name)

Accessor to the object’s name.

Parameters
namestr

The name of the object.

setShadowedId(self, id)

Accessor to the object’s shadowed id.

Parameters
idint

Internal unique identifier.

setVisibility(self, visible)

Accessor to the object’s visibility state.

Parameters
visiblebool

Visibility flag.