mlmc.moments.Legendre

class mlmc.moments.Legendre(size, domain, ref_domain=None, log=False, safe_eval=True)[source]

Legendre polynomial basis functions for generalized moments.

__init__(size, domain, ref_domain=None, log=False, safe_eval=True)[source]

Initialize the moment function set.

Parameters:
  • size – int Number of moment functions.

  • domain – tuple(float, float) Domain of the input variable (min, max).

  • log – bool If True, use logarithmic transformation of the domain.

  • safe_eval – bool If True, clip transformed values outside the reference domain and replace them with NaN.

Methods

__init__(size, domain[, ref_domain, log, ...])

Initialize the moment function set.

change_size(size)

Return a new moment object with a different number of basis functions.

clip(value)

Clip values to the reference domain, replacing outliers with NaN.

eval(i, value)

Evaluate the i-th moment function.

eval_all(value[, size])

Evaluate all moments up to the specified size.

eval_all_der(value[, size, degree])

Evaluate derivatives of all moment functions.

eval_diff(value[, size])

Evaluate first derivatives of all moment functions.

eval_diff2(value[, size])

Evaluate second derivatives of all moment functions.

eval_single_moment(i, value)

Evaluate a single moment function (less efficient for large i).

inv_linear(value)

Inverse linear transformation back to the original domain.

linear(value)

Apply linear transformation to reference domain.