This page describes the FunctionalModel methods.
Methods
- F(x, y)
Calculate y = F(x) using armadillo library and write results to y without allocating new memory. This method is used only by the other components of the kernel.
- Parameters:
x (ndarray) – Vector of the functional model parameters (L dimension).
y (ndarray) – Vector of results (D dimension).
- getDimensionY()
Return the D dimension of the problem.
- Returns:
The dimension D of the problem.
- getDimensionX()
Return the L dimension of the problem.
- Returns:
The dimension L of the problem.
- toPhysic(x)
Transform the values of x from the mathematical space to the physical space.
- Parameters:
x (ndarray) – The vector to normalize.
- fromPhysic(x)
Transform the values of x from the physical space to the mathematical space.
- Parameters:
x (ndarray) – The vector to normalize.
- genData(N, generator_type, noise, seed)
Generate a complete learning dataset from the generator type and the FunctionalModel.
- Parameters:
N (int) – Number of generated observations.
generator_type (str) – The type of the generator used to generate x_gen matrix values.
noise (float, ndarray) – Vector of dimension D corresponding to the y_i variances.
seed (int) – Seed number for random generators.
- Returns:
A generated dataset composed of a pair (x_gen, y_gen) with x_gen of shape (L, N) and y_gen of shape (D, N).
- importanceSampling(proposition_gmms, y, y_err, N_0, B=0, J=0, covariance=0, idx_gaussian=-1, verbose=1, seed=0)
Perform importance sampling with given parameters.
- Parameters:
proposition_gmms (list[(1-D ndarray, 2-D ndarray, 3-D ndarray)],
FullGMMResult
,MergedGMMResult
) –List of GMM propositions. The GMMs can be defined by the three following objects :
(list[(1-D ndarray, 2-D ndarray, 3-D ndarray)]) A Python list with length N_obs containing each GMM defined as a tuple of 3 elements:
weigths (ndarray of shape (K)),
means (ndarray of shape (L, K)),
covariance matrices (ndarray of shape (K, L, L)).
(
FullGMMResult
) The full GMM calculated with inverseDensities method.(
MergedGMMResult
) The merged GMM calculated with inverseDensities method.
y (ndarray with shape(D, N_obs)) – Matrix y.
y_err (ndarray with shape(D, N_obs)) – Matrix of y errors.
N_0 (int) – Initial number of samples.
B (int) – (optional) Parameter B.
J (int) – (optional) Parameter J.
covariance (ndarray with shape(D)) – (optional) Covariance vector with shape (D).
idx_gaussian (int) – (optional) Index of the desired gaussian from the merged GMM. Starts from 0 and ends at K_merged - 1. Perform importance sampling with given parameters on the specified gaussian of the GMMs.
verbose (int) – (optional) The verbosity of the logging among {0, 1, 2}.
seed (int) – (optional) The seed for random generation. It helps with reproducibility.
- Returns:
An instance of
ImportanceSamplingResult
containing the importance sampling results.