SG++-Doxygen-Documentation
Loading...
Searching...
No Matches
sgpp::optimization::SplineResponseSurface Class Reference

stores a sparse grid not a knot B-spline interpolant in the framework of a respsonse surface More...

#include <SplineResponseSurface.hpp>

Inheritance diagram for sgpp::optimization::SplineResponseSurface:
sgpp::optimization::ResponseSurface

Public Member Functions

double eval (sgpp::base::DataVector v) override
 evaluates this response surface
 
double evalGradient (sgpp::base::DataVector v, sgpp::base::DataVector &gradient) override
 evaluates the response surface and its gradient
 
sgpp::base::DataVector getCoefficients ()
 
std::shared_ptr< sgpp::base::GridgetGrid ()
 
double getIntegral ()
 return the integral of the response surface
 
sgpp::base::DataVector getLowerBounds ()
 
double getMean (sgpp::base::DistributionsVector pdfs, size_t quadOrder)
 return the mean of the response surface w.r.t.
 
size_t getSize ()
 
sgpp::base::DataVector getUpperBounds ()
 
sgpp::base::DataVector getVariance (sgpp::base::DistributionsVector pdfs, size_t quadOrder)
 return the variance of the response surface w.r.t.
 
void nextSurplusAdaptiveGrid (size_t refinementsNum, bool verbose=false)
 refines the grid surplus adaptive but does not recalculate interpolation coefficients
 
sgpp::base::DataVector optimize ()
 calculates the minimimum with gradient descent
 
void refineSurplusAdaptive (size_t refinementsNum, bool verbose=false)
 refines the grid surplus adaptive and recalculates the interpoaltion coefficients
 
void regular (size_t level)
 creates a regular sparse grid interpolant
 
void regularByPoints (size_t numPoints, bool verbose=false)
 creates a regular grid of the lowest level with more grid points than specified
 
void ritterNovak (size_t maxNumGridPoints, double gamma, size_t initialLevel=3, bool verbose=false)
 creates an adaptive grid based on Ritter-Novak this is favourable for optimization
 
 SplineResponseSurface (std::shared_ptr< sgpp::base::Grid > grid, sgpp::base::DataVector coefficients, sgpp::base::DataVector lb, sgpp::base::DataVector ub, size_t degree=3)
 Constructor.
 
 SplineResponseSurface (std::shared_ptr< sgpp::base::ScalarFunction > objectiveFunc, sgpp::base::DataVector lb, sgpp::base::DataVector ub, sgpp::base::GridType gridType, size_t degree=3, size_t boundaryLevel=1)
 Constructor.
 
 SplineResponseSurface (std::shared_ptr< sgpp::base::ScalarFunction > objectiveFunc, std::shared_ptr< sgpp::base::Grid > grid, sgpp::base::DataVector lb, sgpp::base::DataVector ub, size_t degree=3)
 Constructor.
 
void surplusAdaptive (size_t maxNumGridPoints, size_t initialLevel, size_t refinementsNum=3, bool verbose=false)
 creates a surplus adaptive sparse grid interpolant
 
 ~SplineResponseSurface () override
 Destructor.
 
- Public Member Functions inherited from sgpp::optimization::ResponseSurface
double l2Error (std::shared_ptr< sgpp::base::ScalarFunction > objectiveFunc, size_t numMCPoints=1000)
 Calculates the l2 error between interpolant and objective function.
 
sgpp::base::DataVector nrmsError (std::shared_ptr< sgpp::base::ScalarFunction > objectiveFunc, size_t numMCPoints=1000)
 Calculates the normalized root mean square error between interpolant and objective function in random points.
 
sgpp::base::DataVector nrmsErrorFromTestData (const std::string &fileName, size_t numMCPoints, size_t numDim)
 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 ResponseSurface::precalculateErrorTestData)
 
void precalculateErrorTestData (std::shared_ptr< sgpp::base::ScalarFunction > objectiveFunc, size_t numMCPoints, const std::string &fileName)
 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.
 
 ResponseSurface (size_t numDim)
 Constructor.
 
virtual ~ResponseSurface ()
 Destructor.
 

Additional Inherited Members

- Protected Member Functions inherited from sgpp::optimization::ResponseSurface
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 inherited from sgpp::optimization::ResponseSurface
std::shared_ptr< sgpp::base::ScalarFunctioninterpolant
 
std::shared_ptr< sgpp::base::ScalarFunctionGradientinterpolantGradient
 
sgpp::base::DataVector lb
 
size_t numDim
 
sgpp::base::DataVector ub
 

Detailed Description

stores a sparse grid not a knot B-spline interpolant in the framework of a respsonse surface

Constructor & Destructor Documentation

◆ SplineResponseSurface() [1/3]

sgpp::optimization::SplineResponseSurface::SplineResponseSurface ( std::shared_ptr< sgpp::base::ScalarFunction objectiveFunc,
sgpp::base::DataVector  lb,
sgpp::base::DataVector  ub,
sgpp::base::GridType  gridType,
size_t  degree = 3,
size_t  boundaryLevel = 1 
)
inline

◆ SplineResponseSurface() [2/3]

◆ SplineResponseSurface() [3/3]

◆ ~SplineResponseSurface()

sgpp::optimization::SplineResponseSurface::~SplineResponseSurface ( )
inlineoverride

Destructor.

Member Function Documentation

◆ eval()

double sgpp::optimization::SplineResponseSurface::eval ( sgpp::base::DataVector  v)
overridevirtual

◆ evalGradient()

double sgpp::optimization::SplineResponseSurface::evalGradient ( sgpp::base::DataVector  v,
sgpp::base::DataVector gradient 
)
overridevirtual

evaluates the response surface and its gradient

Parameters
vpoint to evaluate in
gradientreference to return the repsonse surfaces gradient evaluted in v
Returns
the evaluation

Implements sgpp::optimization::ResponseSurface.

References sgpp::base::DataVector::getSize(), sgpp::optimization::ResponseSurface::interpolantGradient, sgpp::optimization::ResponseSurface::lb, sgpp::optimization::ResponseSurface::transformPoint(), and sgpp::optimization::ResponseSurface::ub.

◆ getCoefficients()

sgpp::base::DataVector sgpp::optimization::SplineResponseSurface::getCoefficients ( )
inline
Returns
the interpolation coefficients

◆ getGrid()

◆ getIntegral()

double sgpp::optimization::SplineResponseSurface::getIntegral ( )

◆ getLowerBounds()

sgpp::base::DataVector sgpp::optimization::SplineResponseSurface::getLowerBounds ( )
inline
Returns
the lower bounds of the domain

References sgpp::optimization::ResponseSurface::lb.

◆ getMean()

double sgpp::optimization::SplineResponseSurface::getMean ( sgpp::base::DistributionsVector  pdfs,
size_t  quadOrder 
)

return the mean of the response surface w.r.t.

a probability density function

Parameters
pdfsthe probability density function
quadOrderorder of the Gauss Legendre quadrature

References sgpp::op_factory::createOperationWeightedQuadrature(), and sgpp::base::OperationWeightedQuadrature::doWeightedQuadrature().

Referenced by getVariance().

◆ getSize()

◆ getUpperBounds()

sgpp::base::DataVector sgpp::optimization::SplineResponseSurface::getUpperBounds ( )
inline
Returns
the upper bounds of the domain

References sgpp::optimization::ResponseSurface::ub.

◆ getVariance()

sgpp::base::DataVector sgpp::optimization::SplineResponseSurface::getVariance ( sgpp::base::DistributionsVector  pdfs,
size_t  quadOrder 
)

return the variance of the response surface w.r.t.

a probability density function

Parameters
pdfsthe probability density function
quadOrderorder of the Gauss Legendre quadrature
Returns
vector [v,mS,m] containing the variance v and the meanSquare mS and mean m used to compute it

References sgpp::op_factory::createOperationWeightedSecondMoment(), sgpp::base::OperationWeightedSecondMoment::doWeightedQuadrature(), and getMean().

◆ nextSurplusAdaptiveGrid()

void sgpp::optimization::SplineResponseSurface::nextSurplusAdaptiveGrid ( size_t  refinementsNum,
bool  verbose = false 
)

refines the grid surplus adaptive but does not recalculate interpolation coefficients

Parameters
refinementsNumnumber of grid points which should be refined
verboseprint information on the refine points

Referenced by refineSurplusAdaptive().

◆ optimize()

◆ refineSurplusAdaptive()

void sgpp::optimization::SplineResponseSurface::refineSurplusAdaptive ( size_t  refinementsNum,
bool  verbose = false 
)

refines the grid surplus adaptive and recalculates the interpoaltion coefficients

Parameters
refinementsNumnumber of grid points which should be refined
verboseprint information on the refine points

References nextSurplusAdaptiveGrid().

Referenced by surplusAdaptive().

◆ regular()

void sgpp::optimization::SplineResponseSurface::regular ( size_t  level)

creates a regular sparse grid interpolant

Parameters
levellevel of the regular sparse grid

References sgpp::optimization::ResponseSurface::interpolant, sgpp::optimization::ResponseSurface::interpolantGradient, level, sgpp::base::ModPoly, and sgpp::base::PolyBoundary.

Referenced by surplusAdaptive().

◆ regularByPoints()

void sgpp::optimization::SplineResponseSurface::regularByPoints ( size_t  numPoints,
bool  verbose = false 
)

creates a regular grid of the lowest level with more grid points than specified

Parameters
numPointsdesired number of grid points
verboseprint extra info

References sgpp::optimization::ResponseSurface::interpolant, sgpp::optimization::ResponseSurface::interpolantGradient, level, sgpp::base::ModPoly, and sgpp::base::PolyBoundary.

◆ ritterNovak()

void sgpp::optimization::SplineResponseSurface::ritterNovak ( size_t  maxNumGridPoints,
double  gamma,
size_t  initialLevel = 3,
bool  verbose = false 
)

creates an adaptive grid based on Ritter-Novak this is favourable for optimization

Parameters
maxNumGridPointsmaximum number of grid points of the interpolants grid
gammaRitter Novak adaptivity parameter between 0 and1
initialLevelinitial level for the refinement
verboseprint extra info

References sgpp::optimization::IterativeGridGeneratorRitterNovak::generate(), sgpp::optimization::ResponseSurface::interpolant, and sgpp::optimization::ResponseSurface::interpolantGradient.

◆ surplusAdaptive()

void sgpp::optimization::SplineResponseSurface::surplusAdaptive ( size_t  maxNumGridPoints,
size_t  initialLevel,
size_t  refinementsNum = 3,
bool  verbose = false 
)

creates a surplus adaptive sparse grid interpolant

Parameters
maxNumGridPointsmaximum number of grid points of the interpolants grid
initialLevelfirst a regular grid of initialLevel is created.
refinementsNummax number of grid points, added in each refinement step
verboseprint extra info

References sgpp::optimization::ResponseSurface::interpolant, sgpp::optimization::ResponseSurface::interpolantGradient, sgpp::base::ModPoly, sgpp::base::PolyBoundary, refineSurplusAdaptive(), and regular().


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