Response Surfaces

Utilities for exploiting active subspaces in response surfaces.

class active_subspaces.response_surfaces.ActiveSubspaceResponseSurface(avmap, respsurf=None)

A class for using active subspace with response surfaces.

respsurf

ResponseSurface

respsurf is a utils.response_surfaces.ResponseSurface

avmap

ActiveVariableMap

a domains.ActiveVariableMap

Notes

This class has several convenient functions for training and using a response surface with active subspaces. Note that the avmap must be given. This means that the active subspace must be computed already.

gradient(X)

Gradient of the response surface.

A convenience function for computing the gradient of the response surface with respect to the simulation inputs.

Parameters:X (ndarray) – M-by-m matrix containing points in the space of simulation inputs
Returns:df – contains the response surface gradient at the given X
Return type:ndarray
gradient_av(Y)

Compute the gradient with respect to the active variables.

A convenience function for computing the gradient of the response surface with respect to the active variables.

Parameters:Y (ndarray) – M-by-n matrix containing points in the range of active variables to evaluate the response surface gradient
Returns:df – contains the response surface gradient at the given Y
Return type:ndarray
predict(X, compgrad=False)

Evaluate the response surface at full space points.

Compute the value of the response surface given values of the simulation variables.

Parameters:
  • X (ndarray) – M-by-m matrix containing points in simulation’s parameter space
  • compgrad (bool, optional) – determines if the gradient of the response surface is computed and returned (default False)
Returns:

  • f (ndarray) – contains the response surface values at the given X
  • dfdx (ndarray) – an ndarray of shape M-by-m that contains the estimated gradient at the given X. If compgrad is False, then dfdx is None.

predict_av(Y, compgrad=False)

Evaluate response surface at active variable.

Compute the value of the response surface given values of the active variables.

Parameters:
  • Y (ndarray) – M-by-n matrix containing points in the range of active variables to evaluate the response surface
  • compgrad (bool, optional) – determines if the gradient of the response surface with respect to the active variables is computed and returned (default False)
Returns:

  • f (ndarray) – contains the response surface values at the given Y
  • df (ndarray) – contains the response surface gradients at the given Y. If compgrad is False, then df is None.

train_with_data(X, f, v=None)

Train the response surface with input/output pairs.

Parameters:
  • X (ndarray) – M-by-m matrix with evaluations of the simulation inputs
  • f (ndarray) – M-by-1 matrix with corresponding simulation quantities of interest
  • v (ndarray, optional) – M-by-1 matrix that contains the regularization (i.e., errors) associated with f (default None)

Notes

The training methods exploit the eigenvalues from the active subspace analysis to determine length scales for each variable when tuning the parameters of the radial bases.

The method sets attributes of the object for further use.

train_with_interface(fun, N, NMC=10)

Train the response surface with input/output pairs.

Parameters:
  • fun (function) – a function that returns the simulation quantity of interest given a point in the input space as an 1-by-m ndarray
  • N (int) – the number of points used in the design-of-experiments for constructing the response surface
  • NMC (int, optional) – the number of points used to estimate the conditional expectation and conditional variance of the function given a value of the active variables

Notes

The training methods exploit the eigenvalues from the active subspace analysis to determine length scales for each variable when tuning the parameters of the radial bases.

The method sets attributes of the object for further use.

The method uses the response_surfaces.av_design function to get the design for the appropriate avmap.

active_subspaces.response_surfaces.av_design(avmap, N, NMC=10)

Design on active variable space.

A wrapper that returns the design for the response surface in the space of the active variables.

Parameters:
  • avmap (ActiveVariableMap) – a domains.ActiveVariable map that includes the active variable domain, which includes the active and inactive subspaces
  • N (int) – the number of points used in the design-of-experiments for constructing the response surface
  • NMC (int, optional) – the number of points used to estimate the conditional expectation and conditional variance of the function given a value of the active variables (Default is 10)
Returns:

  • Y (ndarray) – N-by-n matrix that contains the design points in the space of active variables
  • X (ndarray) – (N*NMC)-by-m matrix that contains points in the simulation input space to run the simulation
  • ind (ndarray) – indices that map points in X to points in Y

See also

utils.designs.gauss_hermite_design(), utils.designs.interval_design(), utils.designs.maximin_design()