SG++-Doxygen-Documentation
Loading...
Searching...
No Matches
sgpp::optimization::ResponseSurfaceVector Class Referenceabstract

General response surface. More...

#include <ResponseSurfaceVector.hpp>

Inheritance diagram for sgpp::optimization::ResponseSurfaceVector:
sgpp::optimization::SplineResponseSurfaceVector

Public Member Functions

sgpp::base::DataVector averageL2Error (std::shared_ptr< sgpp::base::VectorFunction > objectiveFunc, sgpp::base::DataVector &componentwiseErrors, size_t numMCPoints=1000)
 Calculates the average l2 error between interpolant and objective function.
 
sgpp::base::DataVector averageNRMSE (std::shared_ptr< sgpp::base::VectorFunction > objectiveFunc, sgpp::base::DataMatrix &componentwiseErrorData, size_t numMCPoints=1000)
 Calculates the normalized root mean square error between interpolant and objective function at random points.
 
virtual sgpp::base::DataVector eval (sgpp::base::DataVector v)
 evaluates the response surface
 
virtual sgpp::base::DataVector evalJacobian (sgpp::base::DataVector v, sgpp::base::DataMatrix &jacobian)=0
 evaluates the response surface and its gradients
 
size_t getNumDim ()
 Calculates the normalized root mean square error between interpolant and objective function from a precalculated set of test points and according values (this set is usually generated by ResponseSurfaceVector::precalculateErrorTestData)
 
size_t getNumRes ()
 
 ResponseSurfaceVector (size_t numDim, size_t numRes)
 Constructor.
 
virtual ~ResponseSurfaceVector ()
 Destructor.
 

Protected Member Functions

double domainVolume ()
 calculates the volume of the tensor product domain given by lb and ub
 
void transformPoint (sgpp::base::DataVector &v, sgpp::base::DataVector lBounds, sgpp::base::DataVector uBounds, sgpp::base::DataVector newlBounds, sgpp::base::DataVector newuBounds)
 transforms a point in hyper-rectangle [lBounds,rBounds] to the hyper-rectangle [newlBounds,newuBounds]
 

Protected Attributes

std::shared_ptr< sgpp::base::VectorFunctionGradientinterpolantGradients
 
std::shared_ptr< sgpp::base::VectorFunctioninterpolants
 
sgpp::base::DataVector lb
 
size_t numDim
 
size_t numRes
 
sgpp::base::DataVector ub
 

Detailed Description

General response surface.

Represents an approximation of some function with vector valued output. Usually the approximation is created via interpolation. (But could also be regression for example)

Constructor & Destructor Documentation

◆ ResponseSurfaceVector()

sgpp::optimization::ResponseSurfaceVector::ResponseSurfaceVector ( size_t  numDim,
size_t  numRes 
)
inlineexplicit

Constructor.

◆ ~ResponseSurfaceVector()

virtual sgpp::optimization::ResponseSurfaceVector::~ResponseSurfaceVector ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ averageL2Error()

sgpp::base::DataVector sgpp::optimization::ResponseSurfaceVector::averageL2Error ( std::shared_ptr< sgpp::base::VectorFunction objectiveFunc,
sgpp::base::DataVector componentwiseErrors,
size_t  numMCPoints = 1000 
)

Calculates the average l2 error between interpolant and objective function.

Parameters
objectiveFuncthe objectiveFunction
componentwiseErrorsreference to return the l2 error in each individual of the numRes components
numMCPointsnumber of Monte Carlo Points
Returns
vector with [average l2 error, min l2 error, max l2 error]

References sgpp::base::DataVector::abs(), sgpp::base::DataVector::add(), sgpp::base::DataVector::componentwise_mult(), eval(), sgpp::base::RandomNumberGenerator::getInstance(), sgpp::base::RandomNumberGenerator::getUniformRN(), lb, sgpp::base::DataVector::max(), sgpp::base::DataVector::min(), numDim, numRes, sgpp::base::DataVector::resizeZero(), sgpp::base::DataVector::sub(), and ub.

◆ averageNRMSE()

sgpp::base::DataVector sgpp::optimization::ResponseSurfaceVector::averageNRMSE ( std::shared_ptr< sgpp::base::VectorFunction objectiveFunc,
sgpp::base::DataMatrix componentwiseErrorData,
size_t  numMCPoints = 1000 
)

Calculates the normalized root mean square error between interpolant and objective function at random points.

Parameters
objectiveFuncthe objectiveFunction
componentwiseErrorDatareference to return the NRMSE, l2, min and max for each individual of the numRes components
numMCPointsnumber of Monte Carlo Points
Returns
vector [average NRMSE, average l2 error, min NRMSE, max NRMSE]

References sgpp::base::DataVector::abs(), sgpp::base::DataVector::add(), averageNRMSE(), sgpp::base::DataVector::componentwise_mult(), eval(), sgpp::base::RandomNumberGenerator::getInstance(), sgpp::base::RandomNumberGenerator::getUniformRN(), lb, sgpp::base::DataVector::max(), sgpp::base::DataVector::min(), numDim, numRes, sgpp::base::DataMatrix::resize(), sgpp::base::DataMatrix::setRow(), sgpp::base::DataVector::sub(), and ub.

Referenced by averageNRMSE().

◆ domainVolume()

double sgpp::optimization::ResponseSurfaceVector::domainVolume ( )
protected

calculates the volume of the tensor product domain given by lb and ub

Returns
volume

References lb, numDim, and ub.

Referenced by sgpp::optimization::SplineResponseSurfaceVector::getIntegrals().

◆ eval()

sgpp::base::DataVector sgpp::optimization::ResponseSurfaceVector::eval ( sgpp::base::DataVector  v)
virtual

evaluates the response surface

Parameters
vpoint in which the response surface shall be evaulated
Returns
evaluation

Reimplemented in sgpp::optimization::SplineResponseSurfaceVector.

References interpolants, and numRes.

Referenced by averageL2Error(), averageNRMSE(), and python.uq.analysis.asgc.ASGCAnalysis.ASGCAnalysis::estimateDensity().

◆ evalJacobian()

virtual sgpp::base::DataVector sgpp::optimization::ResponseSurfaceVector::evalJacobian ( sgpp::base::DataVector  v,
sgpp::base::DataMatrix jacobian 
)
pure virtual

evaluates the response surface and its gradients

Parameters
vpoint in which the response surface shall be evaluated
jacobianreference to return the jacobian evaluated in v. Each row is one gradient
Returns
evaluation

Implemented in sgpp::optimization::SplineResponseSurfaceVector.

◆ getNumDim()

size_t sgpp::optimization::ResponseSurfaceVector::getNumDim ( )
inline

Calculates the normalized root mean square error between interpolant and objective function from a precalculated set of test points and according values (this set is usually generated by ResponseSurfaceVector::precalculateErrorTestData)

Parameters
fileNamepath to the stored data set
numMCPointsthe first numMCPoints of the data set are used
numDimnumber of dimensions
Returns
vector [NRMSE, l2 error, min, max] Evaluates the objective function in random points and stores these points with the according evaluation value The stored set of test data can then later be used to calculate and compare the approximation error
Parameters
objectiveFuncthe objective function
numMCPointsnumber of Monte carlo Points
pathpath specifying where to save the generated data

References numDim.

◆ getNumRes()

size_t sgpp::optimization::ResponseSurfaceVector::getNumRes ( )
inline

References numRes.

◆ transformPoint()

void sgpp::optimization::ResponseSurfaceVector::transformPoint ( sgpp::base::DataVector v,
sgpp::base::DataVector  lBounds,
sgpp::base::DataVector  uBounds,
sgpp::base::DataVector  newlBounds,
sgpp::base::DataVector  newuBounds 
)
protected

transforms a point in hyper-rectangle [lBounds,rBounds] to the hyper-rectangle [newlBounds,newuBounds]

Parameters
vpoint in [lBounds,uBounds]
lBoundslower bounds
uBoundsupper bounds
newlBoundsnew lower bounds
newuBoundsnew upper bounds

References sgpp::base::DataVector::add(), sgpp::base::DataVector::componentwise_div(), sgpp::base::DataVector::componentwise_mult(), and sgpp::base::DataVector::sub().

Referenced by sgpp::optimization::SplineResponseSurfaceVector::eval(), and sgpp::optimization::SplineResponseSurfaceVector::evalJacobian().

Member Data Documentation

◆ interpolantGradients

◆ interpolants

◆ lb

◆ numDim

◆ numRes

◆ ub


The documentation for this class was generated from the following files: