Skip to main content

Pce

Struct Pce 

Source
pub struct Pce {
    pub indices: Vec<Vec<usize>>,
    pub coefficients: Vec<f64>,
    pub total_variance: f64,
    pub sobol_first_order: Vec<f64>,
    pub sobol_total: Vec<f64>,
    pub r_squared: f64,
}
Expand description

Polynomial chaos expansion — a Hermite-polynomial surrogate with analytic Sobol’ sensitivity indices.

Fields§

§indices: Vec<Vec<usize>>

Multi-indices of the retained basis terms.

§coefficients: Vec<f64>

Regression coefficients per term.

§total_variance: f64

Total variance of the surrogate (Σ c²).

§sobol_first_order: Vec<f64>

Sobol’ main-effect indices per input dimension (first-order).

§sobol_total: Vec<f64>

Sobol’ total-effect indices per input dimension.

§r_squared: f64

R² of the surrogate fit (determination coefficient).

Implementations§

Source§

impl Pce

Source

pub fn fit( x: &[Vec<f64>], y: &[f64], bounds: &[(f64, f64)], max_degree: usize, ) -> Self

Fit a PCE to the given samples.

x inputs must be normalized to the box bounds (each column in [lo, hi]); standardization to N(0,1) happens internally via ξ = 2·(x − lo)/(hi − lo) − 1 (an affine map — acceptable for PCE on bounded boxes).

Auto Trait Implementations§

§

impl Freeze for Pce

§

impl RefUnwindSafe for Pce

§

impl Send for Pce

§

impl Sync for Pce

§

impl Unpin for Pce

§

impl UnsafeUnpin for Pce

§

impl UnwindSafe for Pce

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.