emulation module
- class surmise.emulator(x=None, theta=None, f=None, method='PCGP', passthroughfunc=None, args={}, options={})[source]
A class used to represent an emulator or surrogate model. Fits an emulator or surrogate model provided in
emulationmethods/[method].pywhere [method] is the user option with default listed above.Tip
To use a new emulator, just drop a new file to the
emulationmethods/directory with the required formatting.- Example:
emulator(x=x, theta=theta, f=f, method='PCGP', args=args)
- Parameters:
x (numpy.ndarray, optional) – An array of inputs. Each row should correspond to a row in f. The default is None. We will attempt to resolve size differences.
theta (numpy.ndarray, optional) – An array of parameters. Each row in theta should correspond to a column in f. The default is None. We will attempt to resolve size differences.
f (numpy.ndarray, optional) – An array of responses with ‘nan’ representing responses not yet available. The default is None. Each column in f should correspond to a row in x. Each row should correspond to a row in f. We will attempt to resolve if these are flipped.
method (str, optional) – A string that points to the file located in
emulationmethods/. The default isPCGP.passthroughfunc (function, optional) – DESCRIPTION. The default is None.
args (dict, optional) – Optional dictionary containing options you would like to pass to [method].fit(x, theta, f, args) or [method].predict(x, theta, args) The default is {}.
options (dict, optional) – Dictionary containing options you would like emulation to have. This does not get passed to the method. The default is {}.
- class surmise.emulation.prediction(_info, emu)[source]
Bases:
objectA class to represent an emulation prediction. predict._info returns the dictionary from the method.
- Example:
prediction.mean() prediction.var() prediction.covx() prediction.rnd()
- covxhalf(args=None)[source]
Returns the sqrt of the covariance matrix at theta and x when building the prediction. That is, if this returns A = predict.covhalf(.)[k], then A.T @ A = predict.cov(.)[k]
- covxhalf_gradtheta(args=None)[source]
Returns the gradient of the covxhalf matrix at theta and x when building the prediction.
- mean_gradtheta(args=None)[source]
Returns the gradient of the mean at theta and x with respect to theta when building the prediction.