![]() |
SG++-Doxygen-Documentation
|
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>
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::Grid > | getGrid () |
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. | |
![]() | |
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 | |
![]() | |
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::VectorFunctionGradient > | interpolantGradients |
std::shared_ptr< sgpp::base::VectorFunction > | interpolants |
sgpp::base::DataVector | lb |
size_t | numDim |
size_t | numRes |
sgpp::base::DataVector | ub |
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)
|
inline |
Constructor.
objectiveFunc | objective Function |
lb | lower parameter boundaries |
ub | upper parameter boundaries |
gridType | type of the interpolants grid/basis |
degree | degree of the interpolants basis |
References sgpp::base::Bspline, sgpp::base::BsplineBoundary, sgpp::base::BsplineClenshawCurtis, sgpp::base::FundamentalSpline, sgpp::optimization::ResponseSurfaceVector::lb, sgpp::base::ModBspline, sgpp::base::ModFundamentalSpline, sgpp::base::ModNakBspline, sgpp::base::NakBspline, sgpp::base::NakBsplineBoundary, sgpp::base::NakBsplineExtended, sgpp::base::NakPBspline, sgpp::optimization::ResponseSurfaceVector::numDim, sgpp::optimization::ResponseSurfaceVector::numRes, sgpp::base::DataMatrix::resize(), sgpp::base::DataMatrix::setColumn(), and sgpp::optimization::ResponseSurfaceVector::ub.
|
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)
numDim | input dimensionality |
numRes | output dimensionality |
lb | lower parameter boundaries |
ub | upper parameter boundaries |
gridFilename | path to the file with stored grid data |
degree | basis degree |
coeffFileName | path 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().
|
inlineoverride |
Destructor.
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
maxNumGridPoints | maximum number of grid points of the interpolants grid |
initialLevel | first a regular grid of initialLevel is created. |
pdfs | the probability density functions 'distributions' |
refinementsNum | max number of grid points, added in each refinement step |
verbose | print extra info |
References sgpp::optimization::ResponseSurfaceVector::interpolantGradients, sgpp::optimization::ResponseSurfaceVector::interpolants, refineDistributionAdaptive(), and regular().
|
overridevirtual |
evaluates this response surface
v | point to evaluate in |
Reimplemented from sgpp::optimization::ResponseSurfaceVector.
References sgpp::optimization::ResponseSurfaceVector::interpolants, sgpp::optimization::ResponseSurfaceVector::lb, sgpp::optimization::ResponseSurfaceVector::transformPoint(), and sgpp::optimization::ResponseSurfaceVector::ub.
Referenced by python.uq.analysis.asgc.ASGCAnalysis.ASGCAnalysis::estimateDensity().
|
overridevirtual |
evaluates the response surface and its gradient
v | point to evaluate in |
jacobian | reference to return the repsonse surfaces jacobian matrix evaluted in v |
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.
void sgpp::optimization::SplineResponseSurfaceVector::full | ( | size_t | level | ) |
creates a regualar full grid interpolant
level | level of the regular full grid |
References sgpp::optimization::ResponseSurfaceVector::interpolantGradients, sgpp::optimization::ResponseSurfaceVector::interpolants, and level.
|
inline |
|
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().
sgpp::base::DataVector sgpp::optimization::SplineResponseSurfaceVector::getIntegrals | ( | ) |
return the integrals of the response surface
References sgpp::op_factory::createOperationQuadrature(), sgpp::optimization::ResponseSurfaceVector::domainVolume(), sgpp::base::OperationQuadrature::doQuadrature(), sgpp::base::DataMatrix::getColumn(), and sgpp::optimization::ResponseSurfaceVector::numRes.
|
inline |
References sgpp::optimization::ResponseSurfaceVector::lb.
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
pdfs | the probability density function |
quadOrder | order of the Gauss Legendre quadrature |
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().
|
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::ResponseSurfaceVector::ub.
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
pdfs | the probability density function |
quadOrder | order of the Gauss Legendre quadrature |
means | reference to return the means used to calculate the variances |
meanSquares | reference to return the meanSquares used to calculate 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().
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
refinementsNum | number of grid points which should be refined |
pdfs | the probability density functions 'distributions' |
verbose | print information on the refine points |
Referenced by refineDistributionAdaptive().
void sgpp::optimization::SplineResponseSurfaceVector::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().
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
refinementsNum | number of grid points which should be refined |
pdfs | the probability density functions 'distributions' |
verbose | print information on the refine points |
References nextDistributionAdaptiveGrid().
Referenced by distributionAdaptive().
void sgpp::optimization::SplineResponseSurfaceVector::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::SplineResponseSurfaceVector::regular | ( | size_t | level | ) |
creates a regualar sparse grid interpolant
level | level of the regular sparse grid |
References sgpp::optimization::ResponseSurfaceVector::interpolantGradients, sgpp::optimization::ResponseSurfaceVector::interpolants, and level.
Referenced by distributionAdaptive(), and surplusAdaptive().
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
numPoints | desired number of grid points |
verbose | print extra info |
References sgpp::optimization::ResponseSurfaceVector::interpolantGradients, sgpp::optimization::ResponseSurfaceVector::interpolants, and level.
std::string sgpp::optimization::SplineResponseSurfaceVector::serializeGrid | ( | ) |
calculates the minimimum with gradient descent
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
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::ResponseSurfaceVector::interpolantGradients, sgpp::optimization::ResponseSurfaceVector::interpolants, refineSurplusAdaptive(), and regular().