conditional_moments_of_polynomial_chaos_expansion

pyapprox.multivariate_polynomials.conditional_moments_of_polynomial_chaos_expansion(poly, samples, inactive_idx, return_variance=False)[source]

Return mean and variance of polynomial chaos expansion with some variables fixed at specified values.

Parameters
poly: PolynomialChaosExpansion

The polynomial used to compute moments

inactive_idxnp.ndarray (ninactive_vars)

The indices of the fixed variables

samplesnp.ndarray (ninactive_vars)

The samples of the inacive dimensions fixed when computing moments

Returns
meannp.ndarray

The conditional mean (num_qoi)

variancenp.ndarray

The conditional variance (num_qoi). Only returned if return_variance=True. Computing variance is significantly slower than computing mean. TODO check it is indeed slower