bayesvalidrox.surrogate_models.input_space.InputSpace

class bayesvalidrox.surrogate_models.input_space.InputSpace(input_object, meta_model_type='pce')

Bases: object

This class generates the input space for the metamodel from the distributions provided using the Input object.

Attributes

Inputobj

Input object containing the parameter marginals, i.e. name, distribution type and distribution parameters or available raw data.

meta_model_typestr

Type of the meta_model_type.

__init__(input_object, meta_model_type='pce')

Methods

__init__(input_object[, meta_model_type])

build_polytypes(rosenblatt)

Creates the polynomial types to be passed to univ_basis_vals method of the MetaModel object.

check_valid_inputs()

Check if the given input_object is valid to use for further calculations: 1) Has some Marginals 2) The Marginals have valid priors 3) All Marginals given as the same type (samples vs dist)

init_param_space([max_deg])

Initializes parameter space.

random_sampler(n_samples[, max_deg])

Samples the given raw data randomly.

transform(X[, params, method])

Transforms the samples via either a Rosenblatt or an isoprobabilistic transformation.

build_polytypes(rosenblatt)

Creates the polynomial types to be passed to univ_basis_vals method of the MetaModel object.

Parameters

rosenblattbool

Rosenblatt transformation flag.

Returns

orig_space_distobject

A chaospy j_dist object or a gaussian_kde object.

poly_typeslist

A list of polynomial types for the parameters.

check_valid_inputs() None

Check if the given input_object is valid to use for further calculations: 1) Has some Marginals 2) The Marginals have valid priors 3) All Marginals given as the same type (samples vs dist)

Returns

None

init_param_space(max_deg=1)

Initializes parameter space.

Parameters

max_degint, optional

Maximum degree. The default is 1.

Returns

raw_dataarray of shape (n_params, n_samples)

Raw data.

bound_tupleslist of tuples

A list containing lower and upper bounds of parameters.

random_sampler(n_samples, max_deg=1)

Samples the given raw data randomly.

Parameters

n_samplesint

Number of requested samples.

max_degint, optional

Maximum degree. The default is 1. This will be used to run init_param_space, if it has not been done until now.

Returns

samples: array of shape (n_samples, n_params)

The sampling locations in the input space.

transform(X, params=None, method=None)

Transforms the samples via either a Rosenblatt or an isoprobabilistic transformation.

Parameters

Xarray of shape (n_samples,n_params)

Samples to be transformed.

paramslist

Parameters for laguerre/gamma-type distribution.

methodstring

If transformation method is ‘user’ transform X, else just pass X.

Returns

tr_x: array of shape (n_samples,n_params)

Transformed samples.