25 #ifndef UQ_GPMSA_HELPER_H
26 #define UQ_GPMSA_HELPER_H
30 #include <queso/Environment.h>
31 #include <queso/ScalarFunction.h>
32 #include <queso/VectorSpace.h>
33 #include <queso/VectorRV.h>
34 #include <queso/ConcatenatedVectorRV.h>
35 #include <queso/GammaVectorRV.h>
36 #include <queso/BetaVectorRV.h>
37 #include <queso/UniformVectorRV.h>
38 #include <queso/GPMSAOptions.h>
39 #include <queso/ScopedPtr.h>
40 #include <queso/SharedPtr.h>
47 template <
class V = GslVector,
class M = GslMatrix>
67 const V & residual_in,
68 const M & BT_Wy_B_inv_in,
69 const M & KT_K_inv_in,
74 virtual double lnValue(
const V & domainVector,
75 const V * domainDirection,
78 V * hessianEffect)
const;
81 const V * domainDirection,
84 V * hessianEffect)
const;
126 template <
class V = GslVector,
class M = GslMatrix>
326 void print(std::ostream& os)
const;
427 std::vector<const BaseVectorRV<V, M> *>
priors;
487 #endif // UQ_GPMSA_HELPER_H
std::shared_ptr< T > Type
std::vector< typename SharedPtr< V >::Type > m_discrepancyBases
ScopedPtr< VectorSpace< V, M > >::Type oneDSpace
ScopedPtr< V >::Type m_emulatorPrecisionShapeVec
ScopedPtr< V >::Type m_emulatorPrecisionScaleVec
ScopedPtr< GammaVectorRV< V, M > >::Type m_emulatorDataPrecision
ScopedPtr< V >::Type m_observationalPrecisionShapeVec
ScopedPtr< V >::Type truncationErrorPrecisionMax
ScopedPtr< UniformVectorRV< V, M > >::Type m_truncationErrorPrecision
A templated (base) class for handling scalar functions.
ScopedPtr< V >::Type truncationErrorPrecisionMin
std::vector< typename SharedPtr< M >::Type > m_observationErrorMatrices
const GPMSAOptions & options() const
Return GPMSAOptions structure.
friend std::ostream & operator<<(std::ostream &os, const GPMSAFactory< V, M > &obj)
ScopedPtr< BoxSubset< V, M > >::Type totalDomain
std::vector< typename SharedPtr< V >::Type > m_discrepancyBases
const VectorSpace< V, M > & m_parameterSpace
std::vector< typename SharedPtr< V >::Type > m_simulationParameters
unsigned int numSimulations() const
Return number of simulations.
std::vector< typename SharedPtr< V >::Type > m_experimentScenarios
ScopedPtr< V >::Type emulatorCorrelationMax
const V & simulationParameter(unsigned int simulationId) const
Return the point in parameterSpace for simulation simulationId.
A class representing a vector space.
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
ScopedPtr< BoxSubset< V, M > >::Type emulatorPrecisionDomain
const BaseEnvironment & m_env
M & getObservationErrorCovariance(unsigned int simulationNumber)
ScopedPtr< VectorSpace< V, M > >::Type emulatorCorrelationSpace
const BaseEnvironment & env() const
Return the QUESO environment.
ScopedPtr< BoxSubset< V, M > >::Type emulatorDataPrecisionDomain
ScopedPtr< GPMSAEmulator< V, M > >::Type gpmsaEmulator
std::vector< M > m_discrepancyMatrices
const VectorSpace< V, M > & parameterSpace() const
Return the vector space in which parameters live.
const VectorSpace< V, M > & simulationOutputSpace() const
Return the vector space in which simulations live.
const GPMSAEmulator< V, M > & getGPMSAEmulator() const
Return the GPMSAEmulator likelihood object.
const VectorSpace< V, M > & m_simulationOutputSpace
const ConcatenatedVectorRV< V, M > & m_totalPrior
ScopedPtr< ConcatenatedVectorRV< V, M > >::Type m_totalPrior
const VectorSpace< V, M > & experimentOutputSpace() const
Return the vector space in which experiments live.
const std::vector< typename SharedPtr< V >::Type > & experimentOutputs() const
Return all points in experimentOutputSpace for all experiments.
ScopedPtr< V >::Type m_emulatorDataPrecisionShapeVec
ScopedPtr< V >::Type observationalPrecisionMin
ScopedPtr< V >::Type emulatorPrecisionMin
SharedPtr< M >::Type m_observationErrorMatrix
const std::vector< typename SharedPtr< M >::Type > & m_observationErrorMatrices
ScopedPtr< V >::Type m_emulatorCorrelationStrengthBetaVec
ScopedPtr< BoxSubset< V, M > >::Type discrepancyPrecisionDomain
ScopedPtr< VectorSpace< V, M > >::Type discrepancyCorrelationSpace
ScopedPtr< V >::Type discrepancyPrecisionMin
ScopedPtr< V >::Type observationalPrecisionMax
ScopedPtr< V >::Type emulatorCorrelationMin
virtual double lnValue(const V &domainVector, const V *domainDirection, V *gradVector, M *hessianMatrix, V *hessianEffect) const
Logarithm of the value of the scalar function. Deprecated.
ScopedPtr< V >::Type residual
A templated class for handling sets.
ScopedPtr< V >::Type m_discrepancyCorrelationStrengthAlphaVec
unsigned int numExperiments() const
Return number of experiments.
ScopedPtr< VectorSpace< V, M > >::Type emulatorPrecisionSpace
const std::vector< typename SharedPtr< V >::Type > & simulationOutputs() const
Return all points in simulationOutputSpace for all simulations.
ScopedPtr< V >::Type totalMaxs
unsigned int num_svd_terms
ScopedPtr< VectorSpace< V, M > >::Type totalSpace
A class representing concatenated vector RVs.
const VectorSpace< V, M > & m_scenarioSpace
ScopedPtr< V >::Type totalMins
const V & experimentOutput(unsigned int experimentId) const
Return the experiment output for experiment experimentId.
void addSimulation(typename SharedPtr< V >::Type simulationScenario, typename SharedPtr< V >::Type simulationParameter, typename SharedPtr< V >::Type simulationOutput)
Add a simulation to this.
~GPMSAFactory()
Destructor.
const std::vector< typename SharedPtr< V >::Type > & m_experimentOutputs
const VectorSpace< V, M > & m_parameterSpace
ScopedPtr< V >::Type emulatorDataPrecisionMin
ScopedPtr< M >::Type KT_K_inv
unsigned int m_numSimulations
const GPMSAOptions & m_opts
unsigned int num_svd_terms
ScopedPtr< V >::Type m_discrepancyPrecisionScaleVec
void print(std::ostream &os) const
void addExperiments(const std::vector< typename SharedPtr< V >::Type > &experimentScenarios, const std::vector< typename SharedPtr< V >::Type > &experimentOutputs, const typename SharedPtr< M >::Type experimentErrors)
Add all experiments to this.
GPMSAEmulator(const VectorSet< V, M > &domain, const VectorSpace< V, M > &m_scenarioSpace, const VectorSpace< V, M > &m_parameterSpace, const VectorSpace< V, M > &m_simulationOutputSpace, const VectorSpace< V, M > &m_experimentOutputSpace, const unsigned int m_numSimulations, const unsigned int m_numExperiments, const std::vector< typename SharedPtr< V >::Type > &m_simulationScenarios, const std::vector< typename SharedPtr< V >::Type > &m_simulationParameters, const std::vector< typename SharedPtr< V >::Type > &m_simulationOutputs, const std::vector< typename SharedPtr< V >::Type > &m_experimentScenarios, const std::vector< typename SharedPtr< V >::Type > &m_experimentOutputs, const std::vector< typename SharedPtr< V >::Type > &m_discrepancyBases, const std::vector< typename SharedPtr< M >::Type > &m_observationErrorMatrices, const typename SharedPtr< M >::Type &m_observationErrorMatrix, const ConcatenatedVectorRV< V, M > &m_totalPrior, const V &residual_in, const M &BT_Wy_B_inv_in, const M &KT_K_inv_in, const GPMSAOptions &opts)
std::vector< typename SharedPtr< V >::Type > m_simulationOutputs
const BaseVectorRV< V, M > & m_parameterPrior
unsigned int m_numExperimentAdds
ScopedPtr< V >::Type m_emulatorDataPrecisionScaleVec
ScopedPtr< M >::Type m_TruncatedSVD_simulationOutputs
const unsigned int m_numExperiments
virtual double actualValue(const V &domainVector, const V *domainDirection, V *gradVector, M *hessianMatrix, V *hessianEffect) const
Actual value of the scalar function.
GPMSAFactory(const BaseEnvironment &env, GPMSAOptions *opts, const BaseVectorRV< V, M > ¶meterPrior, const VectorSpace< V, M > &scenarioSpace, const VectorSpace< V, M > ¶meterSpace, const VectorSpace< V, M > &simulationOutputSpace, const VectorSpace< V, M > &experimentOutputSpace, unsigned int numSimulations, unsigned int numExperiments)
Constructor.
std::vector< typename SharedPtr< V >::Type > m_simulationScenarios
unsigned int m_numSimulationAdds
const ConcatenatedVectorRV< V, M > & prior() const
ScopedPtr< GammaVectorRV< V, M > >::Type m_discrepancyPrecision
ScopedPtr< V >::Type discrepancyCorrelationMin
ScopedPtr< M >::Type m_BMatrix
std::vector< const BaseVectorRV< V, M > * > priors
const VectorSpace< V, M > & m_simulationOutputSpace
const std::vector< typename SharedPtr< V >::Type > & m_simulationParameters
ScopedPtr< VectorSpace< V, M > >::Type observationalPrecisionSpace
const VectorSpace< V, M > & m_experimentOutputSpace
ScopedPtr< V >::Type simulationOutputMeans
void addSimulations(const std::vector< typename SharedPtr< V >::Type > &simulationScenarios, const std::vector< typename SharedPtr< V >::Type > &simulationParameters, const std::vector< typename SharedPtr< V >::Type > &simulationOutputs)
Adds multiple simulations to this.
ScopedPtr< V >::Type emulatorDataPrecisionMax
A templated base class for handling vector RV.
ScopedPtr< BetaVectorRV< V, M > >::Type m_emulatorCorrelationStrength
ScopedPtr< BoxSubset< V, M > >::Type emulatorCorrelationDomain
void setDiscrepancyBases(const std::vector< typename SharedPtr< V >::Type > &discrepancyBases)
Add all discrepancy bases to this.
ScopedPtr< V >::Type discrepancyCorrelationMax
const std::vector< typename SharedPtr< V >::Type > & experimentScenarios() const
Return all points in scenarioSpace for all experiments.
const std::vector< typename SharedPtr< V >::Type > & m_simulationOutputs
unsigned int m_numExperiments
ScopedPtr< V >::Type m_discrepancyCorrelationStrengthBetaVec
ScopedPtr< V >::Type m_observationalPrecisionScaleVec
ScopedPtr< V >::Type m_discrepancyPrecisionShapeVec
ScopedPtr< GammaVectorRV< V, M > >::Type m_emulatorPrecision
const SharedPtr< M >::Type experimentErrors() const
Return all observation error covarince matrices for all experiments.
std::vector< typename SharedPtr< V >::Type > m_experimentOutputs
const std::vector< typename SharedPtr< V >::Type > & simulationScenarios() const
Return all points in scenarioSpace for all simulations.
const std::vector< typename SharedPtr< V >::Type > & simulationParameters() const
Return all points in parameterSpace for all simulations.
const VectorSpace< V, M > & scenarioSpace() const
Return the vector space in which scenarios live.
const V & simulationOutput(unsigned int simulationId) const
Return the simulation output for simulation simulationId.
const V & experimentScenario(unsigned int experimentId) const
Return the point in scenarioSpace for experiment experimentId.
ScopedPtr< GammaVectorRV< V, M > >::Type m_observationalPrecision
ScopedPtr< BoxSubset< V, M > >::Type observationalPrecisionDomain
ScopedPtr< M >::Type BT_Wy_B_inv
ScopedPtr< BetaVectorRV< V, M > >::Type m_discrepancyCorrelationStrength
ScopedPtr< V >::Type emulatorPrecisionMax
const std::vector< typename SharedPtr< V >::Type > & m_experimentScenarios
const std::vector< typename SharedPtr< V >::Type > & m_simulationScenarios
const VectorSpace< V, M > & m_scenarioSpace
This class defines the options that specify the behaviour of the Gaussian process emulator...
const VectorSpace< V, M > & m_experimentOutputSpace
ScopedPtr< BoxSubset< V, M > >::Type truncationErrorPrecisionDomain
ScopedPtr< V >::Type m_emulatorCorrelationStrengthAlphaVec
const unsigned int m_numSimulations
ScopedPtr< BoxSubset< V, M > >::Type discrepancyCorrelationDomain
SharedPtr< M >::Type m_observationErrorMatrix
const V & simulationScenario(unsigned int simulationId) const
Return the point in scenarioSpace for simulation simulationId.
ScopedPtr< V >::Type discrepancyPrecisionMax