mod additive

module additive

Separable rank-1 surrogate and its tempered independence sampler. Separable rank-1 surrogate: the base case of the functional tensor train.

A high-dimensional objective is modelled additively, f(x) ~= c + sum_j g_j(x_j), with each g_j a first-kind Chebyshev energy in one coordinate. This is a rank-1 functional tensor train in the full d coordinates, so it carries no active-subspace collapse and the tempered Gibbs density exp(-f/T) factorises across coordinates exactly when f is separable. That factorisation is what the AdditiveSurrogate::sample independence proposal exploits: each coordinate is drawn from its own 1D tempered marginal exp(-g_j/T)/Z_j(T) by inverse-CDF, in O(d m) with no curse of dimensionality, so a single draw places every coordinate at its tempered optimum at once – the regime an active-subspace surrogate cannot reach.

Like crate::reduced::ChebyshevSurrogate, the surrogate is an Obj-transform: it implements Objective, so every point of the sampling algebra consumes it through the same trait. The fit decouples per coordinate (one degree x degree solve each), which keeps it linear in d and usable at native CUTEst sizes. A Metropolis accept against the true objective debiases the mean-field error when the objective is not separable.

Structs and Unions

struct AdditiveSurrogate

A separable rank-1 Chebyshev energy model c + sum_j g_j(x_j).

Implementations

impl AdditiveSurrogate

Functions

fn bounds(&self) -> &Bounds<f64>

Search-space box of the surrogate.

fn fit(x: ArrayView2<f64>, y: ArrayView1<f64>, bounds: Bounds<f64>, degree: usize) -> Self

Fit the surrogate to pilot points x (n x d) and values y (n) with a default of 12 backfitting passes.

fn fit_backfit(x: ArrayView2<f64>, y: ArrayView1<f64>, bounds: Bounds<f64>, degree: usize, n_passes: usize) -> Self

Fit by backfitting (Gauss-Seidel over coordinates).

The intercept is the pilot mean. Each coordinate’s Chebyshev coefficients are refit in turn against the partial residual y - intercept - sum_{l != j} g_l, on a mean-centred design so the fit is consistent under uniform sampling. Sweeping all coordinates n_passes times removes the finite-sample cross-coordinate contamination that an independent per-coordinate fit leaves behind, converging to the joint least-squares additive model while staying O(n_passes d (n degree + degree^3)) – linear in d, unlike the joint solve. Each coordinate’s Gram factor is cached, so a pass costs only one triangular solve per coordinate.

Panics when shapes disagree or degree == 0.

fn gradient(&self, x: ArrayView1<f64>) -> Array1<f64>

Analytic gradient of the separable surrogate at x.

fn sample<R: Rng + ?Sized>(&self, n: usize, temperature: f64, grid_m: usize, rng: &mut R) -> Array2<f64>

Draw n independence proposals from the tempered surrogate density exp(-(f - f_min)/T) by per-coordinate inverse-CDF sampling on an grid_m-point grid. Each coordinate is sampled independently (the separable factorisation), with a uniform within-cell jitter for continuity. Returns an n x d array of points inside the box.

fn value(&self, x: ArrayView1<f64>) -> f64

Surrogate value at full point x.

Traits implemented

impl Objective<f64> for AdditiveSurrogate
impl Gradient<f64> for AdditiveSurrogate