KLExpansion_Full#
- class cuqi.geometry.KLExpansion_Full(grid, std=1.0, cor_len=0.2, nu=3.0, axis_labels=None, **kwargs)#
Class representation of the random field in the sine basis
\[ \begin{align}\begin{aligned}f = \frac{\text{std}^2}{\pi}\sum_{i=0}^{N-2} \left(\frac{\tau^\gamma}{(\tau+i^2)^\gamma}\right) p_i \, \text{sin}\left(\frac{\pi}{N}(i+1)(K+\frac{1}{2})\right)\\+ \frac{\text{std}^2}{\pi}\frac{(-1)^K}{2}\left(\frac{\tau^\gamma}{\left(\tau+(N-1)^2\right)^\gamma}\right) p_{N-1}\end{aligned}\end{align} \]where:
\[\tau = \frac{1}{\text{cor_len}^2},\]\[\gamma = \text{nu}+1,\]\(K=\{0, 1, 2, 3, ..., N-1\}\), \(N\) is the number of nodes in the grid, and \(p_i\) are the expansion coefficients.
The above transformation is the inverse of DST-II (see https://en.wikipedia.org/wiki/Discrete_sine_transform)
- Parameters:
grid (array-like) – One dimensional regular grid on which the random field is defined.
cor_len (float, default 1.0) – The correlation length of the random field.
nu (float, default 2.5) – Smoothness parameter of the random field.
std (float, default 1.0) – Standard deviation of the random field.
- __init__(grid, std=1.0, cor_len=0.2, nu=3.0, axis_labels=None, **kwargs)#
Methods
__init__
(grid[, std, cor_len, nu, axis_labels])fun2par
(funvals)The function to parameter map used to map function values back to parameters, if available.
fun2vec
(funvals)Maps function values to a vector representation of the function values, if available.
par2fun
(p)The parameter to function map used to map parameters to function values in e.g. plotting.
plot
(values[, is_par, plot_par])Plots a function over the set defined by the geometry object.
plot_envelope
(lo_values, hi_values[, ...])Plots an envelope from lower and upper bounds over the set defined by the geometry object.
vec2fun
(funvec)Maps function vector representation, if available, to function values.
Attributes
The dimension of the geometry (function space).
Flag to indicate whether the function value is an array.
The shape of the geometry (function space).
The dimension of the geometry (dimension of the vector representation of the function value).
The shape of the geometry (shape of the vector representation of the function value).
The dimension of the geometry (parameter space).
The shape of the parameter space