![]() |
SG++-Doxygen-Documentation
|
stores a sparse grid not a knot B-spline interpolant in the framework of a respsonse surface More...
#include <SplineResponseSurface.hpp>
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::Grid > | getGrid () |
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. | |
![]() | |
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 | |
![]() | |
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] | |
![]() | |
std::shared_ptr< sgpp::base::ScalarFunction > | interpolant |
std::shared_ptr< sgpp::base::ScalarFunctionGradient > | interpolantGradient |
sgpp::base::DataVector | lb |
size_t | numDim |
sgpp::base::DataVector | ub |
stores a sparse grid not a knot B-spline interpolant in the framework of a respsonse surface
|
inline |
Constructor.
objectiveFunc | objective Function |
lb | lower bounds |
ub | upper bounds |
gridType | type of the interpolants grid/basis |
degree | degree of the interpolants basis |
boundaryLevel | boundary level |
Note: Currently boundaryLevel is only available for gridType nakBsplineBoundary
References sgpp::base::Bspline, sgpp::base::BsplineBoundary, sgpp::base::BsplineClenshawCurtis, sgpp::base::FundamentalSpline, sgpp::optimization::ResponseSurface::lb, sgpp::base::ModBspline, sgpp::base::ModFundamentalSpline, sgpp::base::ModNakBspline, sgpp::base::ModPoly, sgpp::base::ModWeaklyFundamentalNakSpline, sgpp::base::NakBspline, sgpp::base::NakBsplineBoundary, sgpp::base::NakBsplineExtended, sgpp::base::NakPBspline, sgpp::optimization::ResponseSurface::numDim, sgpp::base::PolyBoundary, sgpp::optimization::ResponseSurface::ub, and sgpp::base::WeaklyFundamentalNakSplineBoundary.
|
inline |
Constructor.
objectiveFunc | objective Function |
grid | grid |
lb | lower bounds |
ub | upper bounds |
degree | degree of the interpolants basis |
References sgpp::base::Bspline, sgpp::base::BsplineBoundary, sgpp::base::BsplineClenshawCurtis, sgpp::base::FundamentalSpline, sgpp::optimization::ResponseSurface::interpolant, sgpp::optimization::ResponseSurface::interpolantGradient, sgpp::optimization::ResponseSurface::lb, sgpp::base::ModBspline, sgpp::base::ModFundamentalSpline, sgpp::base::ModNakBspline, sgpp::base::ModPoly, sgpp::base::ModWeaklyFundamentalNakSpline, sgpp::base::NakBspline, sgpp::base::NakBsplineBoundary, sgpp::base::NakBsplineExtended, sgpp::base::NakPBspline, sgpp::optimization::ResponseSurface::numDim, sgpp::base::PolyBoundary, sgpp::optimization::ResponseSurface::ub, and sgpp::base::WeaklyFundamentalNakSplineBoundary.
|
inline |
Constructor.
grid | grid |
coefficients | coefficients matching the grid |
lb | lower bounds |
ub | upper bounds |
degree | degree of the interpolants basis |
References sgpp::base::Bspline, sgpp::base::BsplineBoundary, sgpp::base::BsplineClenshawCurtis, sgpp::base::FundamentalSpline, sgpp::optimization::ResponseSurface::interpolant, sgpp::optimization::ResponseSurface::interpolantGradient, sgpp::optimization::ResponseSurface::lb, sgpp::base::ModBspline, sgpp::base::ModFundamentalSpline, sgpp::base::ModNakBspline, sgpp::base::ModPoly, sgpp::base::ModWeaklyFundamentalNakSpline, sgpp::base::NakBspline, sgpp::base::NakBsplineBoundary, sgpp::base::NakBsplineExtended, sgpp::base::NakPBspline, sgpp::optimization::ResponseSurface::numDim, sgpp::base::PolyBoundary, sgpp::optimization::ResponseSurface::ub, and sgpp::base::WeaklyFundamentalNakSplineBoundary.
|
inlineoverride |
Destructor.
|
overridevirtual |
evaluates this response surface
v | point to evaluate in |
Reimplemented from sgpp::optimization::ResponseSurface.
References sgpp::optimization::ResponseSurface::interpolant, sgpp::optimization::ResponseSurface::lb, sgpp::optimization::ResponseSurface::transformPoint(), and sgpp::optimization::ResponseSurface::ub.
Referenced by python.uq.analysis.asgc.ASGCAnalysis.ASGCAnalysis::estimateDensity().
|
overridevirtual |
evaluates the response surface and its gradient
v | point to evaluate in |
gradient | reference to return the repsonse surfaces gradient evaluted in v |
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.
|
inline |
|
inline |
Referenced by python.uq.analysis.asgc.ASGCKnowledge.ASGCKnowledge::getSparseGridFunction(), python.uq.learner.SimulationLearner.SimulationLearner::learnData(), python.uq.learner.SimulationLearner.SimulationLearner::learnDataWithFolding(), python.uq.learner.SimulationLearner.SimulationLearner::learnDataWithTest(), and python.uq.learner.SimulationLearner.SimulationLearner::refineGrid().
double sgpp::optimization::SplineResponseSurface::getIntegral | ( | ) |
return the integral of the response surface
References sgpp::op_factory::createOperationQuadrature(), sgpp::optimization::ResponseSurface::domainVolume(), and sgpp::base::OperationQuadrature::doQuadrature().
|
inline |
References sgpp::optimization::ResponseSurface::lb.
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
pdfs | the probability density function |
quadOrder | order of the Gauss Legendre quadrature |
References sgpp::op_factory::createOperationWeightedQuadrature(), and sgpp::base::OperationWeightedQuadrature::doWeightedQuadrature().
Referenced by getVariance().
|
inline |
Referenced by python.uq.uq_setting.UQSetting.UQSetting::convert(), python.uq.uq_setting.UQSetting.UQSetting::getTimeDependentResults(), python.uq.uq_setting.UQSetting.UQSetting::runSamples(), and python.uq.uq_setting.UQSetting.UQSetting::runSamples_withoutDistribution().
|
inline |
References sgpp::optimization::ResponseSurface::ub.
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
pdfs | the probability density function |
quadOrder | order of the Gauss Legendre quadrature |
References sgpp::op_factory::createOperationWeightedSecondMoment(), sgpp::base::OperationWeightedSecondMoment::doWeightedQuadrature(), and getMean().
void sgpp::optimization::SplineResponseSurface::nextSurplusAdaptiveGrid | ( | size_t | refinementsNum, |
bool | verbose = false |
||
) |
refines the grid surplus adaptive but does not recalculate interpolation coefficients
refinementsNum | number of grid points which should be refined |
verbose | print information on the refine points |
Referenced by refineSurplusAdaptive().
sgpp::base::DataVector sgpp::optimization::SplineResponseSurface::optimize | ( | ) |
calculates the minimimum with gradient descent
The gradient method needs a starting point. We use the grid point with the smallest (most promising) function value and save it in x0.
References sgpp::optimization::optimizer::UnconstrainedOptimizer::getOptimalPoint(), sgpp::base::DataVector::getPointer(), sgpp::base::DataVector::getSize(), sgpp::optimization::ResponseSurface::interpolant, sgpp::optimization::ResponseSurface::interpolantGradient, sgpp::optimization::ResponseSurface::lb, sgpp::optimization::ResponseSurface::numDim, sgpp::optimization::optimizer::GradientDescent::optimize(), sgpp::optimization::optimizer::UnconstrainedOptimizer::setStartingPoint(), sgpp::optimization::ResponseSurface::transformPoint(), and sgpp::optimization::ResponseSurface::ub.
void sgpp::optimization::SplineResponseSurface::refineSurplusAdaptive | ( | size_t | refinementsNum, |
bool | verbose = false |
||
) |
refines the grid surplus adaptive and recalculates the interpoaltion coefficients
refinementsNum | number of grid points which should be refined |
verbose | print information on the refine points |
References nextSurplusAdaptiveGrid().
Referenced by surplusAdaptive().
void sgpp::optimization::SplineResponseSurface::regular | ( | size_t | level | ) |
creates a regular sparse grid interpolant
level | level 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().
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
numPoints | desired number of grid points |
verbose | print extra info |
References sgpp::optimization::ResponseSurface::interpolant, sgpp::optimization::ResponseSurface::interpolantGradient, level, sgpp::base::ModPoly, and sgpp::base::PolyBoundary.
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
maxNumGridPoints | maximum number of grid points of the interpolants grid |
gamma | Ritter Novak adaptivity parameter between 0 and1 |
initialLevel | initial level for the refinement |
verbose | print extra info |
References sgpp::optimization::IterativeGridGeneratorRitterNovak::generate(), sgpp::optimization::ResponseSurface::interpolant, and sgpp::optimization::ResponseSurface::interpolantGradient.
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
maxNumGridPoints | maximum number of grid points of the interpolants grid |
initialLevel | first a regular grid of initialLevel is created. |
refinementsNum | max number of grid points, added in each refinement step |
verbose | print extra info |
References sgpp::optimization::ResponseSurface::interpolant, sgpp::optimization::ResponseSurface::interpolantGradient, sgpp::base::ModPoly, sgpp::base::PolyBoundary, refineSurplusAdaptive(), and regular().