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

stores a sparse grid not a knot B-spline interpolant in the framework of a respsonse surface for a vector valued objective function (in particular time dependent objective functions, where the return values are the time series) More...

#include <SplineResponseSurfaceVector.hpp>

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

Public Member Functions

void distributionAdaptive (size_t maxNumGridPoints, size_t initialLevel, sgpp::base::DistributionsVector pdfs, size_t refinementsNum=3, bool verbose=false)
 creates a distribution adaptive sparse grid intepolant
 
sgpp::base::DataVector eval (sgpp::base::DataVector v) override
 evaluates this response surface
 
sgpp::base::DataVector evalJacobian (sgpp::base::DataVector v, sgpp::base::DataMatrix &jacobian) override
 evaluates the response surface and its gradient
 
void full (size_t level)
 creates a regualar full grid interpolant
 
sgpp::base::DataMatrix getCoefficients ()
 
size_t getDegree ()
 
std::shared_ptr< sgpp::base::GridgetGrid ()
 
sgpp::base::DataVector getIntegrals ()
 return the integrals of the response surface
 
sgpp::base::DataVector getLowerBounds ()
 
sgpp::base::DataVector getMeans (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 getVariances (sgpp::base::DistributionsVector pdfs, size_t quadOrder, sgpp::base::DataVector &means, sgpp::base::DataVector &meanSquares)
 return the variance of the response surface w.r.t.
 
void nextDistributionAdaptiveGrid (size_t refinementsNum, sgpp::base::DistributionsVector pdfs, bool verbose=false)
 refines the grid distribution adaptive but does not recalculate interpolation coefficients
 
void nextSurplusAdaptiveGrid (size_t refinementsNum, bool verbose=false)
 refines the grid surplus adaptive but does not recalculate interpolation coefficients
 
void refineDistributionAdaptive (size_t refinementsNum, sgpp::base::DistributionsVector pdfs, bool verbose=false)
 refines the grid distribution adaptive and recalculates the interpoaltion coefficients
 
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 regualar 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
 
std::string serializeGrid ()
 calculates the minimimum with gradient descent
 
 SplineResponseSurfaceVector (size_t numDim, size_t numRes, sgpp::base::DataVector lb, sgpp::base::DataVector ub, std::string gridFilename, size_t degree, std::string coeffFileName)
 Constructor loading an already calculated response surface from serialized grid and coefficients (gridFile must be created by Grid::serialize, coeff file by DataMatrix::ToFile)
 
 SplineResponseSurfaceVector (std::shared_ptr< sgpp::base::VectorFunction > objectiveFunc, sgpp::base::DataVector lb, sgpp::base::DataVector ub, sgpp::base::GridType gridType, 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
 
 ~SplineResponseSurfaceVector () override
 Destructor.
 
- Public Member Functions inherited from sgpp::optimization::ResponseSurfaceVector
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.
 
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.
 

Additional Inherited Members

- Protected Member Functions inherited from sgpp::optimization::ResponseSurfaceVector
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::ResponseSurfaceVector
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

stores a sparse grid not a knot B-spline interpolant in the framework of a respsonse surface for a vector valued objective function (in particular time dependent objective functions, where the return values are the time series)

Constructor & Destructor Documentation

◆ SplineResponseSurfaceVector() [1/2]

◆ SplineResponseSurfaceVector() [2/2]

sgpp::optimization::SplineResponseSurfaceVector::SplineResponseSurfaceVector ( size_t  numDim,
size_t  numRes,
sgpp::base::DataVector  lb,
sgpp::base::DataVector  ub,
std::string  gridFilename,
size_t  degree,
std::string  coeffFileName 
)
inline

Constructor loading an already calculated response surface from serialized grid and coefficients (gridFile must be created by Grid::serialize, coeff file by DataMatrix::ToFile)

Parameters
numDiminput dimensionality
numResoutput dimensionality
lblower parameter boundaries
ubupper parameter boundaries
gridFilenamepath to the file with stored grid data
degreebasis degree
coeffFileNamepath to the file with stored coefficients

References sgpp::base::BsplineBoundary, sgpp::base::DataMatrix::fromFile(), sgpp::optimization::ResponseSurfaceVector::interpolantGradients, sgpp::optimization::ResponseSurfaceVector::interpolants, sgpp::optimization::ResponseSurfaceVector::lb, sgpp::base::NakBsplineBoundary, sgpp::optimization::ResponseSurfaceVector::numDim, sgpp::optimization::ResponseSurfaceVector::numRes, sgpp::base::DataMatrix::resize(), sgpp::base::DataMatrix::setColumn(), sgpp::optimization::ResponseSurfaceVector::ub, and sgpp::base::Grid::unserializeFromFile().

◆ ~SplineResponseSurfaceVector()

sgpp::optimization::SplineResponseSurfaceVector::~SplineResponseSurfaceVector ( )
inlineoverride

Destructor.

Member Function Documentation

◆ distributionAdaptive()

void sgpp::optimization::SplineResponseSurfaceVector::distributionAdaptive ( size_t  maxNumGridPoints,
size_t  initialLevel,
sgpp::base::DistributionsVector  pdfs,
size_t  refinementsNum = 3,
bool  verbose = false 
)

creates a distribution adaptive sparse grid intepolant

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

References sgpp::optimization::ResponseSurfaceVector::interpolantGradients, sgpp::optimization::ResponseSurfaceVector::interpolants, refineDistributionAdaptive(), and regular().

◆ eval()

◆ evalJacobian()

sgpp::base::DataVector sgpp::optimization::SplineResponseSurfaceVector::evalJacobian ( sgpp::base::DataVector  v,
sgpp::base::DataMatrix jacobian 
)
overridevirtual

evaluates the response surface and its gradient

Parameters
vpoint to evaluate in
jacobianreference to return the repsonse surfaces jacobian matrix evaluted in v
Returns
the evaluation

Implements sgpp::optimization::ResponseSurfaceVector.

References sgpp::base::DataMatrix::componentwise_div(), sgpp::optimization::ResponseSurfaceVector::interpolantGradients, sgpp::optimization::ResponseSurfaceVector::lb, sgpp::optimization::ResponseSurfaceVector::transformPoint(), and sgpp::optimization::ResponseSurfaceVector::ub.

◆ full()

void sgpp::optimization::SplineResponseSurfaceVector::full ( size_t  level)

creates a regualar full grid interpolant

Parameters
levellevel of the regular full grid

References sgpp::optimization::ResponseSurfaceVector::interpolantGradients, sgpp::optimization::ResponseSurfaceVector::interpolants, and level.

◆ getCoefficients()

sgpp::base::DataMatrix sgpp::optimization::SplineResponseSurfaceVector::getCoefficients ( )
inline
Returns
the interpolation coefficients

◆ getDegree()

size_t sgpp::optimization::SplineResponseSurfaceVector::getDegree ( )
inline
Returns
the degree of the B-splines

◆ getGrid()

◆ getIntegrals()

◆ getLowerBounds()

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

References sgpp::optimization::ResponseSurfaceVector::lb.

◆ getMeans()

sgpp::base::DataVector sgpp::optimization::SplineResponseSurfaceVector::getMeans ( 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
Returns
vector containing the means

References sgpp::op_factory::createOperationWeightedQuadrature(), sgpp::base::OperationWeightedQuadrature::doWeightedQuadrature(), sgpp::base::DataMatrix::getColumn(), sgpp::optimization::ResponseSurfaceVector::numRes, and sgpp::base::DataVector::resizeZero().

Referenced by getVariances().

◆ getSize()

◆ getUpperBounds()

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

References sgpp::optimization::ResponseSurfaceVector::ub.

◆ getVariances()

sgpp::base::DataVector sgpp::optimization::SplineResponseSurfaceVector::getVariances ( sgpp::base::DistributionsVector  pdfs,
size_t  quadOrder,
sgpp::base::DataVector means,
sgpp::base::DataVector meanSquares 
)

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
meansreference to return the means used to calculate the variances
meanSquaresreference to return the meanSquares used to calculate the variances
Returns
vector containing the variances

References sgpp::op_factory::createOperationWeightedSecondMoment(), sgpp::base::OperationWeightedSecondMoment::doWeightedQuadrature(), sgpp::base::DataMatrix::getColumn(), getMeans(), sgpp::optimization::ResponseSurfaceVector::numRes, and sgpp::base::DataVector::resizeZero().

◆ nextDistributionAdaptiveGrid()

void sgpp::optimization::SplineResponseSurfaceVector::nextDistributionAdaptiveGrid ( size_t  refinementsNum,
sgpp::base::DistributionsVector  pdfs,
bool  verbose = false 
)

refines the grid distribution adaptive but does not recalculate interpolation coefficients

Parameters
refinementsNumnumber of grid points which should be refined
pdfsthe probability density functions 'distributions'
verboseprint information on the refine points

Referenced by refineDistributionAdaptive().

◆ nextSurplusAdaptiveGrid()

void sgpp::optimization::SplineResponseSurfaceVector::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().

◆ refineDistributionAdaptive()

void sgpp::optimization::SplineResponseSurfaceVector::refineDistributionAdaptive ( size_t  refinementsNum,
sgpp::base::DistributionsVector  pdfs,
bool  verbose = false 
)

refines the grid distribution adaptive and recalculates the interpoaltion coefficients

Parameters
refinementsNumnumber of grid points which should be refined
pdfsthe probability density functions 'distributions'
verboseprint information on the refine points

References nextDistributionAdaptiveGrid().

Referenced by distributionAdaptive().

◆ refineSurplusAdaptive()

void sgpp::optimization::SplineResponseSurfaceVector::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::SplineResponseSurfaceVector::regular ( size_t  level)

creates a regualar sparse grid interpolant

Parameters
levellevel of the regular sparse grid

References sgpp::optimization::ResponseSurfaceVector::interpolantGradients, sgpp::optimization::ResponseSurfaceVector::interpolants, and level.

Referenced by distributionAdaptive(), and surplusAdaptive().

◆ regularByPoints()

void sgpp::optimization::SplineResponseSurfaceVector::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::ResponseSurfaceVector::interpolantGradients, sgpp::optimization::ResponseSurfaceVector::interpolants, and level.

◆ serializeGrid()

std::string sgpp::optimization::SplineResponseSurfaceVector::serializeGrid ( )

calculates the minimimum with gradient descent

Returns
argmin of the response surface Serialize the grid for storing and later usage
string of the serialized grid

◆ surplusAdaptive()

void sgpp::optimization::SplineResponseSurfaceVector::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::ResponseSurfaceVector::interpolantGradients, sgpp::optimization::ResponseSurfaceVector::interpolants, refineSurplusAdaptive(), and regular().


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