ModelEnsemble

class pyapprox.interface.ModelEnsemble(functions, names=None)[source]

Bases: object

Wrapper class to allow easy one-dimensional indexing of models in an ensemble.

Methods Summary

__call__(samples)

Evaluate a set of models at a set of samples.

evaluate_at_separated_samples(samples_list, ...)

Evaluate a set of models at different sets of samples.

evaluate_models(samples_per_model)

Evaluate a set of models at a set of samples.

Methods Documentation

__call__(samples)[source]

Evaluate a set of models at a set of samples. The models must have the same parameters.

Parameters:
samplesnp.ndarray (nvars+1,nsamples)

Realizations of a multivariate random variable each with an additional scalar model id indicating which model to evaluate.

Returns:
valuesnp.ndarray (nsamples,nqoi)

The values of the models at samples

evaluate_at_separated_samples(samples_list, active_model_ids)[source]

Evaluate a set of models at different sets of samples. The models need not have the same parameters.

Parameters:
samples_listlist[np.ndarray (nvars_ii, nsamples_ii)]

Realizations of the multivariate random variable model to evaluate each model.

active_model_idsiterable

The models to evaluate

Returns:
values_listlist[np.ndarray (nsamples, nqoi)]

The values of the models at the different sets of samples

evaluate_models(samples_per_model)[source]

Evaluate a set of models at a set of samples.

Parameters:
samples_per_modellist (nmodels)

The ith entry contains the set of samples np.narray(nvars, nsamples_ii) used to evaluate the ith model.

Returns:
values_per_modellist (nmodels)

The ith entry contains the set of values np.narray(nsamples_ii, nqoi) obtained from the ith model.