queso-0.57.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
QUESO::GPMSAFactory< V, M > Class Template Reference

#include <GPMSA.h>

Public Member Functions

 GPMSAFactory (const BaseEnvironment &env, GPMSAOptions *opts, const BaseVectorRV< V, M > &parameterPrior, const VectorSpace< V, M > &scenarioSpace, const VectorSpace< V, M > &parameterSpace, const VectorSpace< V, M > &simulationOutputSpace, const VectorSpace< V, M > &experimentOutputSpace, unsigned int numSimulations, unsigned int numExperiments)
 Constructor. More...
 
 ~GPMSAFactory ()
 Destructor. More...
 
void addSimulation (typename SharedPtr< V >::Type simulationScenario, typename SharedPtr< V >::Type simulationParameter, typename SharedPtr< V >::Type simulationOutput)
 Add a simulation to this. More...
 
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. More...
 
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. More...
 
void addExperiments (const std::vector< typename SharedPtr< V >::Type > &experimentScenarios, const std::vector< typename SharedPtr< V >::Type > &experimentOutputs, const std::vector< typename SharedPtr< M >::Type > &experimentErrors)
 Add all experiments to this. More...
 
void setDiscrepancyBases (const std::vector< typename SharedPtr< V >::Type > &discrepancyBases)
 Add all discrepancy bases to this. More...
 
M & getObservationErrorCovariance (unsigned int simulationNumber)
 
const M & getObservationErrorCovariance (unsigned int simulationNumber) const
 
const ConcatenatedVectorRV< V,
M > & 
prior () const
 
void print (std::ostream &os) const
 
void setUpEmulator ()
 
void setUpHyperpriors ()
 
Getters
const GPMSAOptionsoptions () const
 Return GPMSAOptions structure. More...
 
GPMSAOptionsoptions ()
 
unsigned int numSimulations () const
 Return number of simulations. More...
 
unsigned int numExperiments () const
 Return number of experiments. More...
 
const VectorSpace< V, M > & scenarioSpace () const
 Return the vector space in which scenarios live. More...
 
const VectorSpace< V, M > & parameterSpace () const
 Return the vector space in which parameters live. More...
 
const VectorSpace< V, M > & simulationOutputSpace () const
 Return the vector space in which simulations live. More...
 
const VectorSpace< V, M > & experimentOutputSpace () const
 Return the vector space in which experiments live. More...
 
const V & simulationScenario (unsigned int simulationId) const
 Return the point in scenarioSpace for simulation simulationId. More...
 
const std::vector< typename
SharedPtr< V >::Type > & 
simulationScenarios () const
 Return all points in scenarioSpace for all simulations. More...
 
const V & simulationParameter (unsigned int simulationId) const
 Return the point in parameterSpace for simulation simulationId. More...
 
const std::vector< typename
SharedPtr< V >::Type > & 
simulationParameters () const
 Return all points in parameterSpace for all simulations. More...
 
const V & simulationOutput (unsigned int simulationId) const
 Return the simulation output for simulation simulationId. More...
 
const std::vector< typename
SharedPtr< V >::Type > & 
simulationOutputs () const
 Return all points in simulationOutputSpace for all simulations. More...
 
const V & experimentScenario (unsigned int experimentId) const
 Return the point in scenarioSpace for experiment experimentId. More...
 
const std::vector< typename
SharedPtr< V >::Type > & 
experimentScenarios () const
 Return all points in scenarioSpace for all experiments. More...
 
const V & experimentOutput (unsigned int experimentId) const
 Return the experiment output for experiment experimentId. More...
 
const std::vector< typename
SharedPtr< V >::Type > & 
experimentOutputs () const
 Return all points in experimentOutputSpace for all experiments. More...
 
const SharedPtr< M >::Type experimentErrors () const
 Return all observation error covarince matrices for all experiments. More...
 
const BaseEnvironmentenv () const
 Return the QUESO environment. More...
 
const GPMSAEmulator< V, M > & getGPMSAEmulator () const
 Return the GPMSAEmulator likelihood object. More...
 

Public Attributes

const BaseEnvironmentm_env
 
const BaseVectorRV< V, M > & m_parameterPrior
 
const VectorSpace< V, M > & m_scenarioSpace
 
const VectorSpace< V, M > & m_parameterSpace
 
const VectorSpace< V, M > & m_simulationOutputSpace
 
const VectorSpace< V, M > & m_experimentOutputSpace
 
unsigned int m_numSimulations
 
unsigned int m_numExperiments
 
std::vector< typename
SharedPtr< V >::Type > 
m_simulationScenarios
 
std::vector< typename
SharedPtr< V >::Type > 
m_simulationParameters
 
std::vector< typename
SharedPtr< V >::Type > 
m_simulationOutputs
 
std::vector< typename
SharedPtr< V >::Type > 
m_experimentScenarios
 
std::vector< typename
SharedPtr< V >::Type > 
m_experimentOutputs
 
ScopedPtr< V >::Type simulationOutputMeans
 
std::vector< typename
SharedPtr< V >::Type > 
m_discrepancyBases
 
std::vector< typename
SharedPtr< M >::Type > 
m_observationErrorMatrices
 
unsigned int m_numSimulationAdds
 
unsigned int m_numExperimentAdds
 
unsigned int num_svd_terms
 
ScopedPtr< VectorSpace< V, M >
>::Type 
oneDSpace
 
ScopedPtr< V >::Type truncationErrorPrecisionMin
 
ScopedPtr< V >::Type truncationErrorPrecisionMax
 
ScopedPtr< BoxSubset< V, M >
>::Type 
truncationErrorPrecisionDomain
 
ScopedPtr< VectorSpace< V, M >
>::Type 
emulatorPrecisionSpace
 
ScopedPtr< V >::Type emulatorPrecisionMin
 
ScopedPtr< V >::Type emulatorPrecisionMax
 
ScopedPtr< BoxSubset< V, M >
>::Type 
emulatorPrecisionDomain
 
ScopedPtr< VectorSpace< V, M >
>::Type 
emulatorCorrelationSpace
 
ScopedPtr< V >::Type emulatorCorrelationMin
 
ScopedPtr< V >::Type emulatorCorrelationMax
 
ScopedPtr< BoxSubset< V, M >
>::Type 
emulatorCorrelationDomain
 
ScopedPtr< VectorSpace< V, M >
>::Type 
observationalPrecisionSpace
 
ScopedPtr< V >::Type observationalPrecisionMin
 
ScopedPtr< V >::Type observationalPrecisionMax
 
ScopedPtr< BoxSubset< V, M >
>::Type 
observationalPrecisionDomain
 
ScopedPtr< V >::Type discrepancyPrecisionMin
 
ScopedPtr< V >::Type discrepancyPrecisionMax
 
ScopedPtr< BoxSubset< V, M >
>::Type 
discrepancyPrecisionDomain
 
ScopedPtr< VectorSpace< V, M >
>::Type 
discrepancyCorrelationSpace
 
ScopedPtr< V >::Type discrepancyCorrelationMin
 
ScopedPtr< V >::Type discrepancyCorrelationMax
 
ScopedPtr< BoxSubset< V, M >
>::Type 
discrepancyCorrelationDomain
 
ScopedPtr< V >::Type emulatorDataPrecisionMin
 
ScopedPtr< V >::Type emulatorDataPrecisionMax
 
ScopedPtr< BoxSubset< V, M >
>::Type 
emulatorDataPrecisionDomain
 
ScopedPtr< VectorSpace< V, M >
>::Type 
totalSpace
 
ScopedPtr< V >::Type totalMins
 
ScopedPtr< V >::Type totalMaxs
 
ScopedPtr< BoxSubset< V, M >
>::Type 
totalDomain
 
std::vector< const
BaseVectorRV< V, M > * > 
priors
 
ScopedPtr< UniformVectorRV< V,
M > >::Type 
m_truncationErrorPrecision
 
ScopedPtr< GammaVectorRV< V, M >
>::Type 
m_emulatorPrecision
 
ScopedPtr< GammaVectorRV< V, M >
>::Type 
m_observationalPrecision
 
ScopedPtr< BetaVectorRV< V, M >
>::Type 
m_emulatorCorrelationStrength
 
ScopedPtr< GammaVectorRV< V, M >
>::Type 
m_discrepancyPrecision
 
ScopedPtr< BetaVectorRV< V, M >
>::Type 
m_discrepancyCorrelationStrength
 
ScopedPtr< GammaVectorRV< V, M >
>::Type 
m_emulatorDataPrecision
 
ScopedPtr
< ConcatenatedVectorRV< V, M >
>::Type 
m_totalPrior
 
ScopedPtr< V >::Type m_emulatorPrecisionShapeVec
 
ScopedPtr< V >::Type m_emulatorPrecisionScaleVec
 
ScopedPtr< V >::Type m_observationalPrecisionShapeVec
 
ScopedPtr< V >::Type m_observationalPrecisionScaleVec
 
ScopedPtr< V >::Type m_emulatorCorrelationStrengthAlphaVec
 
ScopedPtr< V >::Type m_emulatorCorrelationStrengthBetaVec
 
ScopedPtr< V >::Type m_discrepancyPrecisionShapeVec
 
ScopedPtr< V >::Type m_discrepancyPrecisionScaleVec
 
ScopedPtr< V >::Type m_discrepancyCorrelationStrengthAlphaVec
 
ScopedPtr< V >::Type m_discrepancyCorrelationStrengthBetaVec
 
ScopedPtr< V >::Type m_emulatorDataPrecisionShapeVec
 
ScopedPtr< V >::Type m_emulatorDataPrecisionScaleVec
 
ScopedPtr< GPMSAEmulator< V, M >
>::Type 
gpmsaEmulator
 
bool m_constructedGP
 
SharedPtr< M >::Type m_observationErrorMatrix
 
ScopedPtr< M >::Type m_TruncatedSVD_simulationOutputs
 
std::vector< M > m_discrepancyMatrices
 
ScopedPtr< M >::Type m_BMatrix
 
ScopedPtr< M >::Type K
 
ScopedPtr< V >::Type residual
 
ScopedPtr< M >::Type BT_Wy_B_inv
 
ScopedPtr< M >::Type KT_K_inv
 

Private Attributes

bool allocated_m_opts
 
GPMSAOptionsm_opts
 

Friends

std::ostream & operator<< (std::ostream &os, const GPMSAFactory< V, M > &obj)
 

Detailed Description

template<class V = GslVector, class M = GslMatrix>
class QUESO::GPMSAFactory< V, M >

Definition at line 127 of file GPMSA.h.

Constructor & Destructor Documentation

template<class V , class M >
QUESO::GPMSAFactory< V, M >::GPMSAFactory ( const BaseEnvironment env,
GPMSAOptions opts,
const BaseVectorRV< V, M > &  parameterPrior,
const VectorSpace< V, M > &  scenarioSpace,
const VectorSpace< V, M > &  parameterSpace,
const VectorSpace< V, M > &  simulationOutputSpace,
const VectorSpace< V, M > &  experimentOutputSpace,
unsigned int  numSimulations,
unsigned int  numExperiments 
)

Constructor.

Definition at line 454 of file GPMSA.C.

References QUESO::GPMSAFactory< V, M >::allocated_m_opts, QUESO::VectorSpace< V, M >::dimGlobal(), QUESO::GPMSAFactory< V, M >::m_discrepancyBases, QUESO::GPMSAFactory< V, M >::m_env, QUESO::GPMSAFactory< V, M >::m_experimentOutputSpace, QUESO::GPMSAFactory< V, M >::m_observationErrorMatrices, QUESO::GPMSAFactory< V, M >::m_opts, QUESO::VectorSpace< V, M >::map(), QUESO::GPMSAFactory< V, M >::numExperiments(), and QUESO::BaseEnvironment::optionsInputFileName().

464  :
465  m_env(env),
466  m_parameterPrior(parameterPrior),
480  num_svd_terms(0),
481  priors(),
482  m_constructedGP(false)
483 {
484  // We should have the same number of outputs from both simulations
485  // and experiments
486  queso_assert_equal_to(simulationOutputSpace.dimGlobal(),
487  experimentOutputSpace.dimGlobal());
488 
489  {
490  const unsigned int numOutputs =
491  this->m_experimentOutputSpace.dimLocal();
492  const Map & output_map = experimentOutputSpace.map();
493 
494  // Set up the default discrepancy basis:
495  typename SharedPtr<V>::Type all_ones_basis(new V(env, output_map));
496  for (unsigned int i=0; i != numOutputs; ++i)
497  (*all_ones_basis)[i] = 1;
498  m_discrepancyBases.push_back(all_ones_basis);
499 
500  // Set up the default observation error covariance matrix:
501  for (unsigned int i = 0; i != numExperiments; ++i)
502  {
503  typename SharedPtr<M>::Type identity_matrix(new M(env, output_map, 1.0));
504  m_observationErrorMatrices.push_back(identity_matrix);
505  }
506  }
507 
508  // DM: Not sure if the logic in these 3 if-blocks is correct
509  if ((opts == NULL) && (this->m_env.optionsInputFileName() == "")) {
510  queso_error_msg("Must options object or an input file");
511  }
512 
513  if (opts != NULL) {
514  allocated_m_opts = false;
515  this->m_opts = opts;
516  }
517  else {
518  // Create a default one
519  allocated_m_opts = true;
520  this->m_opts = new GPMSAOptions(this->m_env, "");
521  }
522 
523  // FIXME: WTF? - RHS
524  // this->m_constructedGP = false;
525 }
std::vector< typename SharedPtr< M >::Type > m_observationErrorMatrices
Definition: GPMSA.h:357
std::vector< typename SharedPtr< V >::Type > m_discrepancyBases
Definition: GPMSA.h:355
std::vector< typename SharedPtr< V >::Type > m_simulationParameters
Definition: GPMSA.h:347
unsigned int numSimulations() const
Return number of simulations.
Definition: GPMSA.C:552
std::vector< typename SharedPtr< V >::Type > m_experimentScenarios
Definition: GPMSA.h:349
bool m_constructedGP
Definition: GPMSA.h:454
const BaseEnvironment & m_env
Definition: GPMSA.h:334
const BaseEnvironment & env() const
Return the QUESO environment.
Definition: GPMSA.C:689
const VectorSpace< V, M > & parameterSpace() const
Return the vector space in which parameters live.
Definition: GPMSA.C:573
const VectorSpace< V, M > & simulationOutputSpace() const
Return the vector space in which simulations live.
Definition: GPMSA.C:580
const VectorSpace< V, M > & experimentOutputSpace() const
Return the vector space in which experiments live.
Definition: GPMSA.C:587
std::string optionsInputFileName() const
Access to the attribute m_optionsInputFileName, which stores the name of the input file passed by the...
Definition: Environment.C:354
GPMSAOptions * m_opts
Definition: GPMSA.h:482
unsigned int numExperiments() const
Return number of experiments.
Definition: GPMSA.C:559
const VectorSpace< V, M > & m_scenarioSpace
Definition: GPMSA.h:338
const VectorSpace< V, M > & m_parameterSpace
Definition: GPMSA.h:339
unsigned int m_numSimulations
Definition: GPMSA.h:343
unsigned int num_svd_terms
Definition: GPMSA.h:376
std::vector< typename SharedPtr< V >::Type > m_simulationOutputs
Definition: GPMSA.h:348
const BaseVectorRV< V, M > & m_parameterPrior
Definition: GPMSA.h:336
unsigned int m_numExperimentAdds
Definition: GPMSA.h:361
Definition of a shared pointer.
std::vector< typename SharedPtr< V >::Type > m_simulationScenarios
Definition: GPMSA.h:346
unsigned int m_numSimulationAdds
Definition: GPMSA.h:360
std::vector< const BaseVectorRV< V, M > * > priors
Definition: GPMSA.h:427
const VectorSpace< V, M > & m_simulationOutputSpace
Definition: GPMSA.h:340
bool allocated_m_opts
Definition: GPMSA.h:481
unsigned int m_numExperiments
Definition: GPMSA.h:344
std::vector< typename SharedPtr< V >::Type > m_experimentOutputs
Definition: GPMSA.h:350
const VectorSpace< V, M > & scenarioSpace() const
Return the vector space in which scenarios live.
Definition: GPMSA.C:566
const VectorSpace< V, M > & m_experimentOutputSpace
Definition: GPMSA.h:341
template<class V , class M >
QUESO::GPMSAFactory< V, M >::~GPMSAFactory ( )

Destructor.

Definition at line 528 of file GPMSA.C.

529 {
530  if (this->allocated_m_opts)
531  delete this->m_opts;
532 }
GPMSAOptions * m_opts
Definition: GPMSA.h:482
bool allocated_m_opts
Definition: GPMSA.h:481

Member Function Documentation

template<class V , class M >
void QUESO::GPMSAFactory< V, M >::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.

This method takes a vector of all the experimental data and associated observation errors/correlations and stores them. This cannot be done piecemeal like the simulation data.

Each experiment ([i]) is assumed to correspond to the point expermientScenarios[i] in scenario space. The observation error covariance matrix is assumed to be stored in experimentErrors.

This method is solely for backward compatibility. Covariances between errors from different experiments will be ignored.

Definition at line 951 of file GPMSA.C.

955 {
956  queso_require_less_equal_msg(experimentScenarios.size(), this->m_numExperiments, "too many experiments...");
957 
958  unsigned int offset = 0;
959  for (unsigned int i = 0; i < this->m_experimentScenarios.size(); i++) {
962 
963  const unsigned int outsize =
964  this->m_experimentOutputs[i]->sizeGlobal();
965  for (unsigned int outi = 0; outi != outsize; ++outi)
966  for (unsigned int outj = 0; outj != outsize; ++outj)
967  (*this->m_observationErrorMatrices[i])(outi,outj) =
968  (*experimentErrors)(offset+outi, offset+outj);
969 
970  offset += outsize;
971  }
972 
974 
975  if ((this->m_numSimulationAdds == this->m_numSimulations) &&
976  (this->m_numExperimentAdds == this->m_numExperiments) &&
977  (this->m_constructedGP == false)) {
978  this->setUpEmulator();
979  }
980 }
std::vector< typename SharedPtr< M >::Type > m_observationErrorMatrices
Definition: GPMSA.h:357
std::vector< typename SharedPtr< V >::Type > m_experimentScenarios
Definition: GPMSA.h:349
bool m_constructedGP
Definition: GPMSA.h:454
const std::vector< typename SharedPtr< V >::Type > & experimentOutputs() const
Return all points in experimentOutputSpace for all experiments.
Definition: GPMSA.C:682
unsigned int m_numSimulations
Definition: GPMSA.h:343
unsigned int m_numExperimentAdds
Definition: GPMSA.h:361
unsigned int m_numSimulationAdds
Definition: GPMSA.h:360
void setUpEmulator()
Definition: GPMSA.C:739
const std::vector< typename SharedPtr< V >::Type > & experimentScenarios() const
Return all points in scenarioSpace for all experiments.
Definition: GPMSA.C:663
unsigned int m_numExperiments
Definition: GPMSA.h:344
const SharedPtr< M >::Type experimentErrors() const
Return all observation error covarince matrices for all experiments.
std::vector< typename SharedPtr< V >::Type > m_experimentOutputs
Definition: GPMSA.h:350
template<class V , class M >
void QUESO::GPMSAFactory< V, M >::addExperiments ( const std::vector< typename SharedPtr< V >::Type > &  experimentScenarios,
const std::vector< typename SharedPtr< V >::Type > &  experimentOutputs,
const std::vector< typename SharedPtr< M >::Type > &  experimentErrors 
)

Add all experiments to this.

This method takes a vector of all the experimental data and associated observation errors/correlations and stores them. This cannot be done piecemeal like the simulation data.

Each experiment ([i]) is assumed to correspond to the point expermientScenarios[i] in scenario space. Each experiment has a corresponding error covariance matrix stored in experimentErrors[i]

Definition at line 985 of file GPMSA.C.

989 {
990  queso_require_less_equal_msg(experimentScenarios.size(), this->m_numExperiments, "too many experiments...");
991  queso_require_equal_to(experimentScenarios.size(),
992  experimentOutputs.size());
993  queso_require_equal_to(experimentScenarios.size(),
994  experimentErrors.size());
995 
996  for (unsigned int i = 0; i < this->m_experimentScenarios.size(); i++) {
1000  }
1001  this->m_numExperimentAdds += experimentScenarios.size();
1002 
1003  if ((this->m_numSimulationAdds == this->m_numSimulations) &&
1004  (this->m_numExperimentAdds == this->m_numExperiments) &&
1005  (this->m_constructedGP == false)) {
1006  this->setUpEmulator();
1007  }
1008 }
std::vector< typename SharedPtr< M >::Type > m_observationErrorMatrices
Definition: GPMSA.h:357
std::vector< typename SharedPtr< V >::Type > m_experimentScenarios
Definition: GPMSA.h:349
bool m_constructedGP
Definition: GPMSA.h:454
const std::vector< typename SharedPtr< V >::Type > & experimentOutputs() const
Return all points in experimentOutputSpace for all experiments.
Definition: GPMSA.C:682
unsigned int m_numSimulations
Definition: GPMSA.h:343
unsigned int m_numExperimentAdds
Definition: GPMSA.h:361
unsigned int m_numSimulationAdds
Definition: GPMSA.h:360
void setUpEmulator()
Definition: GPMSA.C:739
const std::vector< typename SharedPtr< V >::Type > & experimentScenarios() const
Return all points in scenarioSpace for all experiments.
Definition: GPMSA.C:663
unsigned int m_numExperiments
Definition: GPMSA.h:344
const SharedPtr< M >::Type experimentErrors() const
Return all observation error covarince matrices for all experiments.
std::vector< typename SharedPtr< V >::Type > m_experimentOutputs
Definition: GPMSA.h:350
template<class V , class M >
void QUESO::GPMSAFactory< V, M >::addSimulation ( typename SharedPtr< V >::Type  simulationScenario,
typename SharedPtr< V >::Type  simulationParameter,
typename SharedPtr< V >::Type  simulationOutput 
)

Add a simulation to this.

The simulation added to this is assumed to correspond to the point simulationScenario in scenario space and simulationParameter in parameter space. The simulation output is assumed to be stored in simulationOutput.

Definition at line 703 of file GPMSA.C.

706 {
707  queso_require_less_msg(this->m_numSimulationAdds, this->m_numSimulations, "too many simulation adds...");
708 
712  this->m_numSimulationAdds++;
713 
714  if ((this->m_numSimulationAdds == this->m_numSimulations) &&
715  (this->m_numExperimentAdds == this->m_numExperiments) &&
716  (this->m_constructedGP == false)) {
717  this->setUpEmulator();
718  }
719 }
std::vector< typename SharedPtr< V >::Type > m_simulationParameters
Definition: GPMSA.h:347
const V & simulationParameter(unsigned int simulationId) const
Return the point in parameterSpace for simulation simulationId.
Definition: GPMSA.C:613
bool m_constructedGP
Definition: GPMSA.h:454
unsigned int m_numSimulations
Definition: GPMSA.h:343
std::vector< typename SharedPtr< V >::Type > m_simulationOutputs
Definition: GPMSA.h:348
unsigned int m_numExperimentAdds
Definition: GPMSA.h:361
std::vector< typename SharedPtr< V >::Type > m_simulationScenarios
Definition: GPMSA.h:346
unsigned int m_numSimulationAdds
Definition: GPMSA.h:360
void setUpEmulator()
Definition: GPMSA.C:739
unsigned int m_numExperiments
Definition: GPMSA.h:344
const V & simulationOutput(unsigned int simulationId) const
Return the simulation output for simulation simulationId.
Definition: GPMSA.C:632
const V & simulationScenario(unsigned int simulationId) const
Return the point in scenarioSpace for simulation simulationId.
Definition: GPMSA.C:594
template<class V , class M >
void QUESO::GPMSAFactory< V, M >::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.

This method takes a vector of simulations and calls addSimulation on each element

Definition at line 723 of file GPMSA.C.

727 {
728  for (unsigned int i = 0; i < this->m_numSimulations; i++) {
731  simulationOutputs[i]);
732  }
733 }
const std::vector< typename SharedPtr< V >::Type > & simulationOutputs() const
Return all points in simulationOutputSpace for all simulations.
Definition: GPMSA.C:644
void addSimulation(typename SharedPtr< V >::Type simulationScenario, typename SharedPtr< V >::Type simulationParameter, typename SharedPtr< V >::Type simulationOutput)
Add a simulation to this.
Definition: GPMSA.C:703
unsigned int m_numSimulations
Definition: GPMSA.h:343
const std::vector< typename SharedPtr< V >::Type > & simulationScenarios() const
Return all points in scenarioSpace for all simulations.
Definition: GPMSA.C:606
const std::vector< typename SharedPtr< V >::Type > & simulationParameters() const
Return all points in parameterSpace for all simulations.
Definition: GPMSA.C:625
template<class V , class M >
const BaseEnvironment & QUESO::GPMSAFactory< V, M >::env ( ) const

Return the QUESO environment.

Definition at line 689 of file GPMSA.C.

690 {
691  return this->m_env;
692 }
const BaseEnvironment & m_env
Definition: GPMSA.h:334
template<class V = GslVector, class M = GslMatrix>
const SharedPtr<M>::Type QUESO::GPMSAFactory< V, M >::experimentErrors ( ) const

Return all observation error covarince matrices for all experiments.

template<class V , class M >
const V & QUESO::GPMSAFactory< V, M >::experimentOutput ( unsigned int  experimentId) const

Return the experiment output for experiment experimentId.

The returned vector is a point in experimentOutputSpace

Definition at line 670 of file GPMSA.C.

References QUESO::size.

672 {
673  queso_require_less_msg(experimentId, (this->m_experimentOutputs).size(), "experimentId is too large");
674 
675  queso_require_msg(this->m_experimentOutputs[experimentId], "vector is NULL");
676 
677  return *(this->m_experimentOutputs[experimentId]);
678 }
std::vector< typename SharedPtr< V >::Type > m_experimentOutputs
Definition: GPMSA.h:350
template<class V , class M >
const std::vector< typename SharedPtr< V >::Type > & QUESO::GPMSAFactory< V, M >::experimentOutputs ( ) const

Return all points in experimentOutputSpace for all experiments.

This returns all points in experiment output space at which experiments were executed

Definition at line 682 of file GPMSA.C.

683 {
684  return this->m_experimentOutputs;
685 }
std::vector< typename SharedPtr< V >::Type > m_experimentOutputs
Definition: GPMSA.h:350
template<class V , class M >
const VectorSpace< V, M > & QUESO::GPMSAFactory< V, M >::experimentOutputSpace ( ) const

Return the vector space in which experiments live.

Definition at line 587 of file GPMSA.C.

588 {
589  return this->m_experimentOutputSpace;
590 }
const VectorSpace< V, M > & m_experimentOutputSpace
Definition: GPMSA.h:341
template<class V , class M >
const V & QUESO::GPMSAFactory< V, M >::experimentScenario ( unsigned int  experimentId) const

Return the point in scenarioSpace for experiment experimentId.

This returns the point in scenario space at which experiment experimentId was executed

Definition at line 651 of file GPMSA.C.

References QUESO::size.

653 {
654  queso_require_less_msg(experimentId, (this->m_experimentScenarios).size(), "experimentId is too large");
655 
656  queso_require_msg(this->m_experimentScenarios[experimentId], "vector is NULL");
657 
658  return *(this->m_experimentScenarios[experimentId]);
659 }
std::vector< typename SharedPtr< V >::Type > m_experimentScenarios
Definition: GPMSA.h:349
template<class V , class M >
const std::vector< typename SharedPtr< V >::Type > & QUESO::GPMSAFactory< V, M >::experimentScenarios ( ) const

Return all points in scenarioSpace for all experiments.

This returns all points in scenario space at which experiments were executed

Definition at line 663 of file GPMSA.C.

664 {
665  return this->m_experimentScenarios;
666 }
std::vector< typename SharedPtr< V >::Type > m_experimentScenarios
Definition: GPMSA.h:349
template<class V , class M >
const GPMSAEmulator< V, M > & QUESO::GPMSAFactory< V, M >::getGPMSAEmulator ( ) const

Return the GPMSAEmulator likelihood object.

Definition at line 696 of file GPMSA.C.

697 {
698  return *(this->gpmsaEmulator);
699 }
ScopedPtr< GPMSAEmulator< V, M > >::Type gpmsaEmulator
Definition: GPMSA.h:453
template<class V , class M >
M & QUESO::GPMSAFactory< V, M >::getObservationErrorCovariance ( unsigned int  simulationNumber)

Definition at line 1027 of file GPMSA.C.

1028 {
1029  queso_assert_less(simulationNumber, m_numSimulations);
1030  queso_assert_equal_to(m_observationErrorMatrices.size(), m_numSimulations);
1031 
1032  return *m_observationErrorMatrices[simulationNumber];
1033 }
std::vector< typename SharedPtr< M >::Type > m_observationErrorMatrices
Definition: GPMSA.h:357
unsigned int m_numSimulations
Definition: GPMSA.h:343
template<class V , class M >
const M & QUESO::GPMSAFactory< V, M >::getObservationErrorCovariance ( unsigned int  simulationNumber) const

Definition at line 1039 of file GPMSA.C.

1040 {
1041  queso_assert_less(simulationNumber, m_numSimulations);
1042  queso_assert_equal_to(m_observationErrorMatrices.size(), m_numSimulations);
1043 
1044  return *m_observationErrorMatrices[simulationNumber];
1045 }
std::vector< typename SharedPtr< M >::Type > m_observationErrorMatrices
Definition: GPMSA.h:357
unsigned int m_numSimulations
Definition: GPMSA.h:343
template<class V , class M >
unsigned int QUESO::GPMSAFactory< V, M >::numExperiments ( ) const

Return number of experiments.

Definition at line 559 of file GPMSA.C.

Referenced by QUESO::GPMSAFactory< V, M >::GPMSAFactory().

560 {
561  return this->m_numExperiments;
562 }
unsigned int m_numExperiments
Definition: GPMSA.h:344
template<class V , class M >
unsigned int QUESO::GPMSAFactory< V, M >::numSimulations ( ) const

Return number of simulations.

Definition at line 552 of file GPMSA.C.

553 {
554  return this->m_numSimulations;
555 }
unsigned int m_numSimulations
Definition: GPMSA.h:343
template<class V , class M >
const GPMSAOptions & QUESO::GPMSAFactory< V, M >::options ( ) const

Return GPMSAOptions structure.

Definition at line 536 of file GPMSA.C.

537 {
538  return *this->m_opts;
539 }
GPMSAOptions * m_opts
Definition: GPMSA.h:482
template<class V , class M >
GPMSAOptions & QUESO::GPMSAFactory< V, M >::options ( )

Definition at line 544 of file GPMSA.C.

545 {
546  return *this->m_opts;
547 }
GPMSAOptions * m_opts
Definition: GPMSA.h:482
template<class V , class M >
const VectorSpace< V, M > & QUESO::GPMSAFactory< V, M >::parameterSpace ( ) const

Return the vector space in which parameters live.

Definition at line 573 of file GPMSA.C.

574 {
575  return this->m_parameterSpace;
576 }
const VectorSpace< V, M > & m_parameterSpace
Definition: GPMSA.h:339
template<class V , class M >
void QUESO::GPMSAFactory< V, M >::print ( std::ostream &  os) const

Definition at line 1058 of file GPMSA.C.

1059 {
1060  // Do nothing
1061 }
template<class V , class M >
const ConcatenatedVectorRV< V, M > & QUESO::GPMSAFactory< V, M >::prior ( ) const

Definition at line 1051 of file GPMSA.C.

1052 {
1053  return *(this->m_totalPrior);
1054 }
ScopedPtr< ConcatenatedVectorRV< V, M > >::Type m_totalPrior
Definition: GPMSA.h:437
template<class V , class M >
const VectorSpace< V, M > & QUESO::GPMSAFactory< V, M >::scenarioSpace ( ) const

Return the vector space in which scenarios live.

Definition at line 566 of file GPMSA.C.

567 {
568  return this->m_scenarioSpace;
569 }
const VectorSpace< V, M > & m_scenarioSpace
Definition: GPMSA.h:338
template<class V , class M >
void QUESO::GPMSAFactory< V, M >::setDiscrepancyBases ( const std::vector< typename SharedPtr< V >::Type > &  discrepancyBases)

Add all discrepancy bases to this.

This method takes a vector of all the bases to use in the discrepancy model and stores a copy.

The user is responsible for normalizing each basis vector to be consistent with the discrepancy precision coefficients which will multiply them.

If no discrepancy basis is provided, a single "1 for each output" vector will be used.

For now we will assume that outputs are the same for each experiment (tau_ij and phi_ij are independent of i, in the notation of Higdon et al), and so each discrepancy basis can be expressed as a vector indexed by output index.

Definition at line 1013 of file GPMSA.C.

1015 {
1016  m_discrepancyBases = discrepancyBases;
1017 
1018  // We should not yet have constructed the underlying GP model
1019  queso_assert_equal_to(this->m_constructedGP, false);
1020 }
std::vector< typename SharedPtr< V >::Type > m_discrepancyBases
Definition: GPMSA.h:355
bool m_constructedGP
Definition: GPMSA.h:454
template<class V , class M >
void QUESO::GPMSAFactory< V, M >::setUpEmulator ( )

Definition at line 739 of file GPMSA.C.

References QUESO::Map::Comm().

740 {
741  this->m_opts->template set_final_scaling<V>
747 
748  const unsigned int numOutputs =
749  this->m_experimentOutputSpace.dimLocal();
750 
752  std::min((unsigned int)(this->m_opts->m_maxEmulatorBasisVectors), numOutputs) :
753  numOutputs;
754 
755  const Map & output_map = m_simulationOutputs[0]->map();
756 
757  const MpiComm & comm = output_map.Comm();
758 
759  Map serial_map(m_numSimulations, 0, comm);
760 
761  const BaseEnvironment &env = m_simulationOutputs[0]->env();
762 
764  (new V (env, output_map));
765 
766  for (unsigned int i=0; i != m_numSimulations; ++i)
767  for (unsigned int j=0; j != numOutputs; ++j)
768  (*simulationOutputMeans)[j] += (*m_simulationOutputs[i])[j];
769 
770  for (unsigned int j=0; j != numOutputs; ++j)
772 
773  M simulation_matrix(env, serial_map, numOutputs);
774 
775  for (unsigned int i=0; i != m_numSimulations; ++i)
776  for (unsigned int j=0; j != numOutputs; ++j)
777  simulation_matrix(i,j) =
778  (*m_simulationOutputs[i])[j] - (*simulationOutputMeans)[j];
779 
780  // GSL only finds left singular vectors if n_rows>=n_columns, so we need to
781  // calculate them indirectly from the eigenvalues of M^T*M
782 
783  M S_trans(simulation_matrix.transpose());
784 
785  M SM_squared(S_trans*simulation_matrix);
786 
787  M SM_singularVectors(env, SM_squared.map(), numOutputs);
788  V SM_singularValues(env, SM_squared.map());
789 
790  SM_squared.eigen(SM_singularValues, &SM_singularVectors);
791 
792  // Copy only those vectors we want into K_eta
794  (new M(env, output_map, num_svd_terms));
795 
796  for (unsigned int i=0; i != numOutputs; ++i)
797  for (unsigned int k = 0; k != num_svd_terms; ++k)
798  (*m_TruncatedSVD_simulationOutputs)(i,k) = SM_singularVectors(i,k);
799 
800  Map copied_map(numOutputs * m_numSimulations, 0, comm);
801 
802  K.reset
803  (new M(env, copied_map, m_numSimulations * num_svd_terms));
804  for (unsigned int k=0; k != num_svd_terms; ++k)
805  for (unsigned int i1=0; i1 != m_numSimulations; ++i1)
806  for (unsigned int i2=0; i2 != numOutputs; ++i2)
807  {
808  const unsigned int i = i1 * numOutputs + i2;
809  const unsigned int j = k * m_numSimulations + i1;
810  (*K)(i,j) = SM_singularVectors(i2,k);
811  }
812 
813  KT_K_inv.reset
814  (new M((K->transpose() * *K).inverse()));
815 
816  Map serial_output_map(numOutputs, 0, comm);
817 
818  for (unsigned int i = 0; i != m_numExperiments; ++i)
819  {
820  M D_i(env, serial_output_map,
821  (unsigned int)(m_discrepancyBases.size()));
822 
823  for (unsigned int j=0; j != numOutputs; ++j)
824  for (unsigned int k=0; k != m_discrepancyBases.size(); ++k)
825  D_i(j,k) = (*m_discrepancyBases[k])[j];
826 
827  m_discrepancyMatrices.push_back(D_i);
828  }
829 
830  // Create the giant matrices!
831 
832  // We build B from two parts, the diag(D_i)*P_D^T block and
833  // the diag(K_i)*P_K^T block, but we build simultaneously so we only
834  // need one loop over experiments.
835  // Since P_D and P_K are permutation matrices we'll just apply the
836  // permutations as we insert.
837 
838  // W_y is simple block diagonal.
839 
840  // Neither of these ought to be dense matrices but we're sacrificing
841  // efficiency for clarity for now.
842 
843  const unsigned int num_discrepancy_bases = m_discrepancyBases.size();
844  const unsigned int Brows = m_numExperiments * numOutputs;
845  const unsigned int Bcols =
846  m_numExperiments * (num_discrepancy_bases + num_svd_terms);
847 
848  const Map B_row_map(Brows, 0, comm);
849 
850  m_BMatrix.reset
851  (new M(env, B_row_map, Bcols));
852 
853  const unsigned int Wyrows = m_numExperiments * numOutputs;
854 
855  const Map Wy_row_map(Wyrows, 0, comm);
856 
858  (new M(env, Wy_row_map, Wyrows));
859 
860  M& B = *m_BMatrix;
861  M& Wy = *m_observationErrorMatrix;
862 
863  for (unsigned int ex = 0; ex != m_numExperiments; ++ex)
864  {
865  const M & D_i = m_discrepancyMatrices[ex];
866 
867  // Each error covariance matrix had better be SPD
868  const M & W_i = (*m_observationErrorMatrices[ex]);
869 #ifndef NDEBUG
870  M W_i_copy(W_i);
871  int rv = W_i_copy.chol();
872  queso_assert_msg(!rv, "Observation error matrix W_" << ex <<
873  " was not SPD!");
874 #endif
875 
876  // For the multivariate case, the bases K_eta computed from
877  // simulator outputs are the same as the bases K_i which apply
878  // to quantities of interest, because simulator outputs are QoIs
879  // alone.
880  //
881  // FIXME - we need to interpolate K_i in the functional case.
882 
883  for (unsigned int outi = 0; outi != numOutputs; ++outi)
884  {
885  unsigned int i = ex*numOutputs+outi;
886  for (unsigned int outj = 0; outj != num_discrepancy_bases; ++outj)
887  {
888  unsigned int j = ex + m_numExperiments * outj;
889 
890  B(i,j) = D_i(outi,outj);
891  }
892 
893  for (unsigned int outj = 0; outj != num_svd_terms; ++outj)
894  {
895  unsigned int j = ex +
896  m_numExperiments * (num_discrepancy_bases + outj);
897 
898  B(i,j) = (*m_TruncatedSVD_simulationOutputs)(outi,outj);
899  }
900 
901  for (unsigned int outj = 0; outj != numOutputs; ++outj)
902  {
903  // No fancy perturbation here
904  unsigned int j = ex*numOutputs+outj;
905 
906  Wy(i,j) = W_i(outi,outj);
907  }
908  }
909  }
910 
911  M BT_Wy_B (B.transpose() * Wy * B);
912 
913  // Adding a "small ridge" to make sure this is invertible, as on
914  // p.577 - using 1e-4 from discussion notes.
915  for (unsigned int i=0; i != Brows; ++i)
916  BT_Wy_B(i,i) += 1.e-4;
917 
918  BT_Wy_B_inv.reset(new M(BT_Wy_B.inverse()));
919 
920  this->setUpHyperpriors();
921 
922  this->m_constructedGP = true;
923  this->gpmsaEmulator.reset
924  (new GPMSAEmulator<V, M>(
925  this->prior().imageSet(),
926  this->m_scenarioSpace,
927  this->m_parameterSpace,
930  this->m_numSimulations,
931  this->m_numExperiments,
932  this->m_simulationScenarios,
933  this->m_simulationParameters,
934  this->m_simulationOutputs,
935  this->m_experimentScenarios,
936  this->m_experimentOutputs,
937  this->m_discrepancyBases,
940  *(this->m_totalPrior),
941  *this->residual,
942  *this->BT_Wy_B_inv,
943  *this->KT_K_inv,
944  *this->m_opts));
945 }
void setUpHyperpriors()
Definition: GPMSA.C:1066
std::vector< typename SharedPtr< M >::Type > m_observationErrorMatrices
Definition: GPMSA.h:357
std::vector< typename SharedPtr< V >::Type > m_discrepancyBases
Definition: GPMSA.h:355
std::vector< typename SharedPtr< V >::Type > m_simulationParameters
Definition: GPMSA.h:347
std::vector< typename SharedPtr< V >::Type > m_experimentScenarios
Definition: GPMSA.h:349
bool m_constructedGP
Definition: GPMSA.h:454
const BaseEnvironment & env() const
Return the QUESO environment.
Definition: GPMSA.C:689
ScopedPtr< GPMSAEmulator< V, M > >::Type gpmsaEmulator
Definition: GPMSA.h:453
std::vector< M > m_discrepancyMatrices
Definition: GPMSA.h:464
ScopedPtr< M >::Type K
Definition: GPMSA.h:469
ScopedPtr< ConcatenatedVectorRV< V, M > >::Type m_totalPrior
Definition: GPMSA.h:437
SharedPtr< M >::Type m_observationErrorMatrix
Definition: GPMSA.h:457
GPMSAOptions * m_opts
Definition: GPMSA.h:482
int m_maxEmulatorBasisVectors
The maximum number of basis vectors to use for approximating.
Definition: GPMSAOptions.h:80
ScopedPtr< V >::Type residual
Definition: GPMSA.h:471
const VectorSpace< V, M > & m_scenarioSpace
Definition: GPMSA.h:338
const VectorSpace< V, M > & m_parameterSpace
Definition: GPMSA.h:339
ScopedPtr< M >::Type KT_K_inv
Definition: GPMSA.h:477
unsigned int m_numSimulations
Definition: GPMSA.h:343
unsigned int num_svd_terms
Definition: GPMSA.h:376
std::vector< typename SharedPtr< V >::Type > m_simulationOutputs
Definition: GPMSA.h:348
ScopedPtr< M >::Type m_TruncatedSVD_simulationOutputs
Definition: GPMSA.h:462
std::vector< typename SharedPtr< V >::Type > m_simulationScenarios
Definition: GPMSA.h:346
const ConcatenatedVectorRV< V, M > & prior() const
Definition: GPMSA.C:1051
ScopedPtr< M >::Type m_BMatrix
Definition: GPMSA.h:466
const VectorSpace< V, M > & m_simulationOutputSpace
Definition: GPMSA.h:340
ScopedPtr< V >::Type simulationOutputMeans
Definition: GPMSA.h:353
unsigned int m_numExperiments
Definition: GPMSA.h:344
std::vector< typename SharedPtr< V >::Type > m_experimentOutputs
Definition: GPMSA.h:350
ScopedPtr< M >::Type BT_Wy_B_inv
Definition: GPMSA.h:474
const VectorSpace< V, M > & m_experimentOutputSpace
Definition: GPMSA.h:341
template<class V , class M >
void QUESO::GPMSAFactory< V, M >::setUpHyperpriors ( )

Definition at line 1066 of file GPMSA.C.

References QUESO::MpiComm::Comm(), and QUESO::scalarProduct().

1067 {
1068  const unsigned int numOutputs =
1069  this->m_experimentOutputSpace.dimLocal();
1070 
1071  const unsigned int num_discrepancy_bases = m_discrepancyBases.size();
1072 
1073  const MpiComm & comm = m_simulationOutputs[0]->map().Comm();
1074 
1075  unsigned int rank_B;
1076  if (m_BMatrix->numRowsGlobal() > m_BMatrix->numCols())
1077  rank_B = m_BMatrix->rank(0, 1.e-4);
1078  else
1079  rank_B = m_BMatrix->transpose().rank(0, 1.e-4);
1080 
1081  double emulatorPrecisionShape = this->m_opts->m_emulatorPrecisionShape;
1082  double emulatorPrecisionScale = this->m_opts->m_emulatorPrecisionScale;
1083 
1084  double observationalPrecisionShape = this->m_opts->m_observationalPrecisionShape;
1085  double observationalPrecisionScale = this->m_opts->m_observationalPrecisionScale;
1086 
1087  if (numOutputs > 1)
1088  {
1089  Map y_map(m_numExperiments * numOutputs, 0, comm);
1090  Map eta_map(m_numSimulations * numOutputs, 0, comm);
1091 
1092  const unsigned int yhat_size =
1093  m_numExperiments * (num_discrepancy_bases + num_svd_terms);
1094 
1095  const unsigned int etahat_size =
1097 
1098  Map zhat_map(yhat_size + etahat_size, 0, comm);
1099 
1100  V y(this->m_env, y_map);
1101  V eta(this->m_env, eta_map);
1102 
1103  for (unsigned int i = 0; i < this->m_numExperiments; i++) {
1104  for (unsigned int k = 0; k != numOutputs; ++k)
1105  y[i*numOutputs+k] =
1106  (*((this->m_experimentOutputs)[i]))[k] -
1107  (*simulationOutputMeans)[k];
1108  }
1109 
1110  for (unsigned int i = 0; i < this->m_numSimulations; i++) {
1111  for (unsigned int k = 0; k != numOutputs; ++k)
1112  eta[i*numOutputs+k] =
1113  (*((this->m_simulationOutputs)[i]))[k] -
1114  (*simulationOutputMeans)[k];
1115  }
1116 
1117  M& B = *m_BMatrix;
1118  M& Wy = *m_observationErrorMatrix;
1119 
1120  V yhat(*BT_Wy_B_inv * (B.transpose() * (Wy * y)));
1121 
1122  queso_assert_equal_to(yhat.sizeGlobal(), yhat_size);
1123 
1124  V etahat(*KT_K_inv * (K->transpose() * eta));
1125 
1126  residual.reset(new V(this->m_env, zhat_map));
1127  for (unsigned int i = 0; i < yhat_size; ++i)
1128  (*residual)[i] = yhat[i];
1129 
1130  for (unsigned int i = 0; i < etahat_size; ++i)
1131  (*residual)[yhat_size+i] = etahat[i];
1132 
1133  emulatorPrecisionShape +=
1134  (this->m_numSimulations * (numOutputs - num_svd_terms)) / 2.0;
1135 
1136  V eta_temp(eta);
1137  eta_temp -= *K * etahat;
1138 
1139  emulatorPrecisionScale +=
1140  scalarProduct(eta, eta_temp) / 2.0;
1141 
1142  observationalPrecisionShape +=
1143  (this->m_numExperiments * numOutputs - rank_B) / 2.0;
1144 
1145  V y_temp(Wy * y);
1146  y_temp -= Wy * B * yhat;
1147 
1148  observationalPrecisionScale +=
1149  scalarProduct(y, y_temp) / 2.0;
1150  }
1151  else
1152  {
1153  const unsigned int totalRuns = this->m_numExperiments + this->m_numSimulations;
1154  Map z_map(totalRuns, 0, comm);
1155  residual.reset(new V (this->m_env, z_map));
1156 
1157  // Form residual = D - mean // = D - mu*1 in (3)
1158  // We currently use the mean of the simulation data, not a free
1159  // hyperparameter mean
1160  for (unsigned int i = 0; i < this->m_numExperiments; i++) {
1161  (*residual)[i] = (*((this->m_experimentOutputs)[i]))[0] -
1162  (*simulationOutputMeans)[0];
1163  }
1164  for (unsigned int i = 0; i < this->m_numSimulations; i++) {
1165  (*residual)[i+this->m_numExperiments] =
1166  (*((this->m_simulationOutputs)[i]))[0] -
1167  (*simulationOutputMeans)[0];
1168  }
1169  }
1170 
1171 
1172  double emulatorCorrelationStrengthAlpha = this->m_opts->m_emulatorCorrelationStrengthAlpha;
1173  double emulatorCorrelationStrengthBeta = this->m_opts->m_emulatorCorrelationStrengthBeta;
1174  double discrepancyPrecisionShape = this->m_opts->m_discrepancyPrecisionShape;
1175  double discrepancyPrecisionScale = this->m_opts->m_discrepancyPrecisionScale;
1176  double discrepancyCorrelationStrengthAlpha = this->m_opts->m_discrepancyCorrelationStrengthAlpha;
1177  double discrepancyCorrelationStrengthBeta = this->m_opts->m_discrepancyCorrelationStrengthBeta;
1178  double emulatorDataPrecisionShape = this->m_opts->m_emulatorDataPrecisionShape;
1179  double emulatorDataPrecisionScale = this->m_opts->m_emulatorDataPrecisionScale;
1180 
1181  this->oneDSpace.reset
1182  (new VectorSpace<V, M>(this->m_env, "", 1, NULL));
1183 
1184  // Truncation error precision
1185  if (this->num_svd_terms < numOutputs)
1186  {
1187  this->truncationErrorPrecisionMin.reset(new V(this->oneDSpace->zeroVector()));
1188  this->truncationErrorPrecisionMax.reset(new V(this->oneDSpace->zeroVector()));
1189  this->truncationErrorPrecisionMin->cwSet(-INFINITY);
1190  this->truncationErrorPrecisionMax->cwSet(INFINITY);
1191 
1192  this->truncationErrorPrecisionDomain.reset
1193  (new BoxSubset<V, M>
1194  ("",
1195  *(this->oneDSpace),
1196  *(this->truncationErrorPrecisionMin),
1197  *(this->truncationErrorPrecisionMax)));
1198 
1199  this->m_truncationErrorPrecision.reset
1200  (new UniformVectorRV<V, M>
1201  ("",
1202  *(this->truncationErrorPrecisionDomain)));
1203  }
1204 
1205  // Emulator precision
1206  this->emulatorPrecisionSpace.reset
1207  (new VectorSpace<V, M>
1208  (this->m_env,
1209  "",
1210  num_svd_terms + (numOutputs > 1),
1211  NULL));
1212 
1213  this->emulatorPrecisionMin.reset
1214  (new V(this->emulatorPrecisionSpace->zeroVector()));
1215  this->emulatorPrecisionMax.reset
1216  (new V(this->emulatorPrecisionSpace->zeroVector()));
1217  this->m_emulatorPrecisionShapeVec.reset
1218  (new V(this->emulatorPrecisionSpace->zeroVector()));
1219  this->m_emulatorPrecisionScaleVec.reset
1220  (new V(this->emulatorPrecisionSpace->zeroVector()));
1221  this->emulatorPrecisionMin->cwSet(0.3);
1222  this->emulatorPrecisionMax->cwSet(INFINITY);
1223  this->m_emulatorPrecisionShapeVec->cwSet(emulatorPrecisionShape);
1224  this->m_emulatorPrecisionScaleVec->cwSet(emulatorPrecisionScale);
1225 
1226  this->emulatorPrecisionDomain.reset
1227  (new BoxSubset<V, M>
1228  ("",
1229  *(this->emulatorPrecisionSpace),
1230  *(this->emulatorPrecisionMin),
1231  *(this->emulatorPrecisionMax)));
1232 
1233  this->m_emulatorPrecision.reset
1234  (new GammaVectorRV<V, M>
1235  ("",
1236  *(this->emulatorPrecisionDomain),
1237  *(this->m_emulatorPrecisionShapeVec),
1238  *(this->m_emulatorPrecisionScaleVec)));
1239 
1240  // Emulator correlation strength
1241  unsigned int dimScenario = (this->scenarioSpace()).dimLocal();
1242  unsigned int dimParameter = (this->parameterSpace()).dimLocal();
1243  this->emulatorCorrelationSpace.reset
1244  (new VectorSpace<V, M>
1245  (this->m_env,
1246  "",
1247  dimScenario + dimParameter,
1248  NULL));
1249 
1250  this->emulatorCorrelationMin.reset
1251  (new V(this->emulatorCorrelationSpace->zeroVector()));
1252  this->emulatorCorrelationMax.reset
1253  (new V(this->emulatorCorrelationSpace->zeroVector()));
1255  (new V(this->emulatorCorrelationSpace->zeroVector()));
1257  (new V(this->emulatorCorrelationSpace->zeroVector()));
1258  this->emulatorCorrelationMin->cwSet(0);
1259  this->emulatorCorrelationMax->cwSet(1);
1260  this->m_emulatorCorrelationStrengthAlphaVec->cwSet(emulatorCorrelationStrengthAlpha);
1261  this->m_emulatorCorrelationStrengthBetaVec->cwSet(emulatorCorrelationStrengthBeta);
1262 
1263  this->emulatorCorrelationDomain.reset
1264  (new BoxSubset<V, M>
1265  ("",
1266  *(this->emulatorCorrelationSpace),
1267  *(this->emulatorCorrelationMin),
1268  *(this->emulatorCorrelationMax)));
1269 
1270  this->m_emulatorCorrelationStrength.reset
1271  (new BetaVectorRV<V, M>
1272  ("",
1273  *(this->emulatorCorrelationDomain),
1276 
1277  // Observation precision
1278  this->observationalPrecisionSpace.reset
1279  (new VectorSpace<V, M>
1280  (this->m_env,
1281  "",
1282  1,
1283  NULL));
1284 
1285  this->observationalPrecisionMin.reset
1286  (new V(this->observationalPrecisionSpace->zeroVector()));
1287  this->observationalPrecisionMax.reset
1288  (new V(this->observationalPrecisionSpace->zeroVector()));
1290  (new V(this->observationalPrecisionSpace->zeroVector()));
1292  (new V(this->observationalPrecisionSpace->zeroVector()));
1293  this->observationalPrecisionMin->cwSet(0.3);
1294  this->observationalPrecisionMax->cwSet(INFINITY);
1299 
1300  this->observationalPrecisionDomain.reset
1301  (new BoxSubset<V, M>
1302  ("",
1303  *(this->observationalPrecisionSpace),
1304  *(this->observationalPrecisionMin),
1305  *(this->observationalPrecisionMax)));
1306 
1307  this->m_observationalPrecision.reset
1308  (new GammaVectorRV<V, M>
1309  ("",
1313 
1314  // Discrepancy precision
1315  this->discrepancyPrecisionMin.reset
1316  (new V(this->oneDSpace->zeroVector()));
1317  this->discrepancyPrecisionMax.reset
1318  (new V(this->oneDSpace->zeroVector()));
1319  this->m_discrepancyPrecisionShapeVec.reset
1320  (new V(this->oneDSpace->zeroVector()));
1321  this->m_discrepancyPrecisionScaleVec.reset
1322  (new V(this->oneDSpace->zeroVector()));
1323  this->discrepancyPrecisionMin->cwSet(0);
1324  this->discrepancyPrecisionMax->cwSet(INFINITY);
1325  this->m_discrepancyPrecisionShapeVec->cwSet(discrepancyPrecisionShape);
1326  this->m_discrepancyPrecisionScaleVec->cwSet(discrepancyPrecisionScale);
1327 
1328  this->discrepancyPrecisionDomain.reset
1329  (new BoxSubset<V, M>
1330  ("",
1331  *(this->oneDSpace),
1332  *(this->discrepancyPrecisionMin),
1333  *(this->discrepancyPrecisionMax)));
1334 
1335  this->m_discrepancyPrecision.reset
1336  (new GammaVectorRV<V, M>
1337  ("",
1338  *(this->discrepancyPrecisionDomain),
1340  *(this->m_discrepancyPrecisionScaleVec)));
1341 
1342  // Discrepancy correlation strength
1343  this->discrepancyCorrelationSpace.reset
1344  (new VectorSpace<V, M>
1345  (this->m_env,
1346  "",
1347  dimScenario,
1348  NULL));
1349 
1350  this->discrepancyCorrelationMin.reset
1351  (new V(this->discrepancyCorrelationSpace->zeroVector()));
1352  this->discrepancyCorrelationMax.reset
1353  (new V(this->discrepancyCorrelationSpace->zeroVector()));
1355  (new V(this->discrepancyCorrelationSpace->zeroVector()));
1357  (new V(this->discrepancyCorrelationSpace->zeroVector()));
1358  this->discrepancyCorrelationMin->cwSet(0);
1359  this->discrepancyCorrelationMax->cwSet(1);
1360  this->m_discrepancyCorrelationStrengthAlphaVec->cwSet(discrepancyCorrelationStrengthAlpha);
1361  this->m_discrepancyCorrelationStrengthBetaVec->cwSet(discrepancyCorrelationStrengthBeta);
1362 
1363  this->discrepancyCorrelationDomain.reset
1364  (new BoxSubset<V, M>
1365  ("",
1366  *(this->discrepancyCorrelationSpace),
1367  *(this->discrepancyCorrelationMin),
1368  *(this->discrepancyCorrelationMax)));
1369 
1371  (new BetaVectorRV<V, M>
1372  ("",
1376 
1377  // Emulator data precision
1378  this->emulatorDataPrecisionMin.reset
1379  (new V(this->oneDSpace->zeroVector()));
1380  this->emulatorDataPrecisionMax.reset
1381  (new V(this->oneDSpace->zeroVector()));
1383  (new V(this->oneDSpace->zeroVector()));
1385  (new V(this->oneDSpace->zeroVector()));
1386  this->emulatorDataPrecisionMin->cwSet(60.0);
1387  this->emulatorDataPrecisionMax->cwSet(1e5);
1388  this->m_emulatorDataPrecisionShapeVec->cwSet(emulatorDataPrecisionShape);
1389  this->m_emulatorDataPrecisionScaleVec->cwSet(emulatorDataPrecisionScale);
1390 
1391  this->emulatorDataPrecisionDomain.reset
1392  (new BoxSubset<V, M>
1393  ("",
1394  *(this->oneDSpace),
1395  *(this->emulatorDataPrecisionMin),
1396  *(this->emulatorDataPrecisionMax)));
1397 
1398  this->m_emulatorDataPrecision.reset
1399  (new GammaVectorRV<V, M>
1400  ("",
1401  *(this->emulatorDataPrecisionDomain),
1404 
1405  // Now form full prior
1406  unsigned int dimSum = 2 +
1407  (this->num_svd_terms < numOutputs) +
1408  (numOutputs > 1) +
1410  num_svd_terms +
1411  dimParameter +
1412  dimParameter +
1413  dimScenario +
1414  dimScenario; // yum
1415 
1416  this->totalSpace.reset
1417  (new VectorSpace<V, M>
1418  (this->m_env,
1419  "",
1420  dimSum,
1421  NULL));
1422  this->totalMins.reset(new V(this->totalSpace->zeroVector()));
1423  this->totalMaxs.reset(new V(this->totalSpace->zeroVector()));
1424 
1425  // Hackety hack McHackington. There's no better way to do this unfortunately
1426  this->totalMins->cwSet(0);
1427  this->totalMaxs->cwSet(1);
1428 
1429  // Min emulator precision
1430  (*(this->totalMins))[dimParameter] = 0.3;
1431  // Max emulator precision
1432  (*(this->totalMaxs))[dimParameter] = INFINITY;
1433 
1434  if (numOutputs > 1)
1435  for (unsigned int basis = 0; basis != num_svd_terms; ++basis)
1436  {
1437  // Min weights precision
1438  (*(this->totalMins))[dimParameter+1+basis] = 0.3;
1439  // Max weights precision
1440  (*(this->totalMaxs))[dimParameter+1+basis] = INFINITY;
1441  }
1442 
1443  // FIXME: F = 1 for now
1444  // Min discrepancy precision
1445  (*(this->totalMins))[dimParameter+(numOutputs>1)+num_svd_terms+dimScenario+dimParameter] = 0;
1446  // Max discrepancy precision
1447  (*(this->totalMaxs))[dimParameter+(numOutputs>1)+num_svd_terms+dimScenario+dimParameter] = INFINITY;
1448 
1449  const int emulator_data_precision_index =
1450  dimSum - 1 - this->m_opts->m_calibrateObservationalPrecision;
1451  (*(this->totalMins))[emulator_data_precision_index] = 60.0; // Min emulator data precision
1452  (*(this->totalMaxs))[emulator_data_precision_index] = 1e5; // Max emulator data precision
1453 
1455  (*(this->totalMins))[dimSum-1] = 0.3; // Min observation error precision
1456  (*(this->totalMaxs))[dimSum-1] = INFINITY; // Max observation error precision
1457  }
1458 
1459  this->totalDomain.reset
1460  (new BoxSubset<V, M>
1461  ("",
1462  *(this->totalSpace),
1463  *(this->totalMins),
1464  *(this->totalMaxs)));
1465 
1466  this->priors.push_back(&(this->m_parameterPrior));
1467 
1468  if (this->num_svd_terms < numOutputs)
1469  this->priors.push_back(this->m_truncationErrorPrecision.get());
1470 
1471  this->priors.push_back(this->m_emulatorPrecision.get());
1472  this->priors.push_back(this->m_emulatorCorrelationStrength.get());
1473  this->priors.push_back(this->m_discrepancyPrecision.get());
1474  this->priors.push_back(this->m_discrepancyCorrelationStrength.get());
1475  this->priors.push_back(this->m_emulatorDataPrecision.get());
1477  this->priors.push_back(this->m_observationalPrecision.get());
1478 
1479  // Finally
1480  this->m_totalPrior.reset
1481  (new ConcatenatedVectorRV<V, M>
1482  ("",
1483  this->priors,
1484  *(this->totalDomain)));
1485 }
ScopedPtr< VectorSpace< V, M > >::Type oneDSpace
Definition: GPMSA.h:379
ScopedPtr< V >::Type m_emulatorPrecisionShapeVec
Definition: GPMSA.h:439
ScopedPtr< V >::Type m_emulatorPrecisionScaleVec
Definition: GPMSA.h:440
ScopedPtr< GammaVectorRV< V, M > >::Type m_emulatorDataPrecision
Definition: GPMSA.h:436
ScopedPtr< V >::Type m_observationalPrecisionShapeVec
Definition: GPMSA.h:441
ScopedPtr< V >::Type truncationErrorPrecisionMax
Definition: GPMSA.h:383
ScopedPtr< UniformVectorRV< V, M > >::Type m_truncationErrorPrecision
Definition: GPMSA.h:430
ScopedPtr< V >::Type truncationErrorPrecisionMin
Definition: GPMSA.h:382
ScopedPtr< BoxSubset< V, M > >::Type totalDomain
Definition: GPMSA.h:425
std::vector< typename SharedPtr< V >::Type > m_discrepancyBases
Definition: GPMSA.h:355
double m_emulatorDataPrecisionScale
The scale parameter for the Gamma hyperprior for the emulator data precision.
Definition: GPMSAOptions.h:232
ScopedPtr< V >::Type emulatorCorrelationMax
Definition: GPMSA.h:395
double m_emulatorCorrelationStrengthBeta
The beta paramter for the Beta hyperprior for the emulator correlation strength.
Definition: GPMSAOptions.h:211
ScopedPtr< BoxSubset< V, M > >::Type emulatorPrecisionDomain
Definition: GPMSA.h:390
const BaseEnvironment & m_env
Definition: GPMSA.h:334
double m_emulatorPrecisionScale
The scale parameter for the Gamma hyperprior for the emulator precision.
Definition: GPMSAOptions.h:192
ScopedPtr< VectorSpace< V, M > >::Type emulatorCorrelationSpace
Definition: GPMSA.h:393
ScopedPtr< BoxSubset< V, M > >::Type emulatorDataPrecisionDomain
Definition: GPMSA.h:418
const VectorSpace< V, M > & parameterSpace() const
Return the vector space in which parameters live.
Definition: GPMSA.C:573
ScopedPtr< M >::Type K
Definition: GPMSA.h:469
ScopedPtr< ConcatenatedVectorRV< V, M > >::Type m_totalPrior
Definition: GPMSA.h:437
ScopedPtr< V >::Type m_emulatorDataPrecisionShapeVec
Definition: GPMSA.h:449
ScopedPtr< V >::Type observationalPrecisionMin
Definition: GPMSA.h:400
ScopedPtr< V >::Type emulatorPrecisionMin
Definition: GPMSA.h:388
SharedPtr< M >::Type m_observationErrorMatrix
Definition: GPMSA.h:457
ScopedPtr< V >::Type m_emulatorCorrelationStrengthBetaVec
Definition: GPMSA.h:444
ScopedPtr< BoxSubset< V, M > >::Type discrepancyPrecisionDomain
Definition: GPMSA.h:407
GPMSAOptions * m_opts
Definition: GPMSA.h:482
ScopedPtr< VectorSpace< V, M > >::Type discrepancyCorrelationSpace
Definition: GPMSA.h:410
ScopedPtr< V >::Type discrepancyPrecisionMin
Definition: GPMSA.h:405
ScopedPtr< V >::Type observationalPrecisionMax
Definition: GPMSA.h:401
ScopedPtr< V >::Type emulatorCorrelationMin
Definition: GPMSA.h:394
ScopedPtr< V >::Type residual
Definition: GPMSA.h:471
double m_discrepancyCorrelationStrengthBeta
The beta paramter for the Beta hyperprior for the discrepancy correlation strength.
Definition: GPMSAOptions.h:223
ScopedPtr< V >::Type m_discrepancyCorrelationStrengthAlphaVec
Definition: GPMSA.h:447
ScopedPtr< VectorSpace< V, M > >::Type emulatorPrecisionSpace
Definition: GPMSA.h:387
double scalarProduct(const GslVector &x, const GslVector &y)
Definition: GslVector.C:1137
ScopedPtr< V >::Type totalMaxs
Definition: GPMSA.h:423
ScopedPtr< VectorSpace< V, M > >::Type totalSpace
Definition: GPMSA.h:421
ScopedPtr< V >::Type totalMins
Definition: GPMSA.h:422
double m_emulatorCorrelationStrengthAlpha
The alpha paramter for the Beta hyperprior for the emulator correlation strength. ...
Definition: GPMSAOptions.h:208
ScopedPtr< V >::Type emulatorDataPrecisionMin
Definition: GPMSA.h:416
ScopedPtr< M >::Type KT_K_inv
Definition: GPMSA.h:477
unsigned int m_numSimulations
Definition: GPMSA.h:343
unsigned int num_svd_terms
Definition: GPMSA.h:376
ScopedPtr< V >::Type m_discrepancyPrecisionScaleVec
Definition: GPMSA.h:446
const BaseVectorRV< V, M > & m_parameterPrior
Definition: GPMSA.h:336
std::vector< typename SharedPtr< V >::Type > m_simulationOutputs
Definition: GPMSA.h:348
ScopedPtr< V >::Type m_emulatorDataPrecisionScaleVec
Definition: GPMSA.h:450
double m_discrepancyPrecisionScale
The scale parameter for the Gamma hyperprior for the discrepancy precision.
Definition: GPMSAOptions.h:217
double m_emulatorPrecisionShape
The shape parameter for the Gamma hyperprior for the emulator precision.
Definition: GPMSAOptions.h:189
double m_discrepancyPrecisionShape
The shape parameter for the Gamma hyperprior for the discrepancy precision.
Definition: GPMSAOptions.h:214
ScopedPtr< GammaVectorRV< V, M > >::Type m_discrepancyPrecision
Definition: GPMSA.h:434
ScopedPtr< V >::Type discrepancyCorrelationMin
Definition: GPMSA.h:411
ScopedPtr< M >::Type m_BMatrix
Definition: GPMSA.h:466
std::vector< const BaseVectorRV< V, M > * > priors
Definition: GPMSA.h:427
ScopedPtr< VectorSpace< V, M > >::Type observationalPrecisionSpace
Definition: GPMSA.h:399
double m_emulatorDataPrecisionShape
The shape parameter for the Gamma hyperprior for the emulator data precision.
Definition: GPMSAOptions.h:229
ScopedPtr< V >::Type simulationOutputMeans
Definition: GPMSA.h:353
bool m_calibrateObservationalPrecision
Whether to use an observational error precision hyperparameter.
Definition: GPMSAOptions.h:198
ScopedPtr< V >::Type emulatorDataPrecisionMax
Definition: GPMSA.h:417
ScopedPtr< BetaVectorRV< V, M > >::Type m_emulatorCorrelationStrength
Definition: GPMSA.h:433
ScopedPtr< BoxSubset< V, M > >::Type emulatorCorrelationDomain
Definition: GPMSA.h:396
ScopedPtr< V >::Type discrepancyCorrelationMax
Definition: GPMSA.h:412
unsigned int m_numExperiments
Definition: GPMSA.h:344
ScopedPtr< V >::Type m_discrepancyCorrelationStrengthBetaVec
Definition: GPMSA.h:448
ScopedPtr< V >::Type m_observationalPrecisionScaleVec
Definition: GPMSA.h:442
ScopedPtr< V >::Type m_discrepancyPrecisionShapeVec
Definition: GPMSA.h:445
double m_discrepancyCorrelationStrengthAlpha
The alpha paramter for the Beta hyperprior for the discrepancy correlation strength.
Definition: GPMSAOptions.h:220
ScopedPtr< GammaVectorRV< V, M > >::Type m_emulatorPrecision
Definition: GPMSA.h:431
std::vector< typename SharedPtr< V >::Type > m_experimentOutputs
Definition: GPMSA.h:350
double m_observationalPrecisionScale
The scale parameter for the Gamma hyperprior for the observational precision.
Definition: GPMSAOptions.h:204
const VectorSpace< V, M > & scenarioSpace() const
Return the vector space in which scenarios live.
Definition: GPMSA.C:566
ScopedPtr< GammaVectorRV< V, M > >::Type m_observationalPrecision
Definition: GPMSA.h:432
ScopedPtr< BoxSubset< V, M > >::Type observationalPrecisionDomain
Definition: GPMSA.h:402
ScopedPtr< M >::Type BT_Wy_B_inv
Definition: GPMSA.h:474
ScopedPtr< BetaVectorRV< V, M > >::Type m_discrepancyCorrelationStrength
Definition: GPMSA.h:435
ScopedPtr< V >::Type emulatorPrecisionMax
Definition: GPMSA.h:389
double m_observationalPrecisionShape
The shape parameter for the Gamma hyperprior for the observational precision.
Definition: GPMSAOptions.h:201
const VectorSpace< V, M > & m_experimentOutputSpace
Definition: GPMSA.h:341
ScopedPtr< BoxSubset< V, M > >::Type truncationErrorPrecisionDomain
Definition: GPMSA.h:384
ScopedPtr< V >::Type m_emulatorCorrelationStrengthAlphaVec
Definition: GPMSA.h:443
ScopedPtr< BoxSubset< V, M > >::Type discrepancyCorrelationDomain
Definition: GPMSA.h:413
ScopedPtr< V >::Type discrepancyPrecisionMax
Definition: GPMSA.h:406
template<class V , class M >
const V & QUESO::GPMSAFactory< V, M >::simulationOutput ( unsigned int  simulationId) const

Return the simulation output for simulation simulationId.

The returned vector is a point in simulationOutputSpace

Definition at line 632 of file GPMSA.C.

634 {
635  queso_require_less_msg(simulationId, m_simulationOutputs.size(), "simulationId is too large");
636 
637  queso_require_msg(m_simulationOutputs[simulationId], "vector is NULL");
638 
639  return *(this->m_simulationOutputs[simulationId]);
640 }
std::vector< typename SharedPtr< V >::Type > m_simulationOutputs
Definition: GPMSA.h:348
template<class V , class M >
const std::vector< typename SharedPtr< V >::Type > & QUESO::GPMSAFactory< V, M >::simulationOutputs ( ) const

Return all points in simulationOutputSpace for all simulations.

This returns all points in simulation output space at which simulations were executed

Definition at line 644 of file GPMSA.C.

645 {
646  return this->m_simulationOutputs;
647 }
std::vector< typename SharedPtr< V >::Type > m_simulationOutputs
Definition: GPMSA.h:348
template<class V , class M >
const VectorSpace< V, M > & QUESO::GPMSAFactory< V, M >::simulationOutputSpace ( ) const

Return the vector space in which simulations live.

Definition at line 580 of file GPMSA.C.

581 {
582  return this->m_simulationOutputSpace;
583 }
const VectorSpace< V, M > & m_simulationOutputSpace
Definition: GPMSA.h:340
template<class V , class M >
const V & QUESO::GPMSAFactory< V, M >::simulationParameter ( unsigned int  simulationId) const

Return the point in parameterSpace for simulation simulationId.

This returns the point in parameter space at which simulation simulationId was executed

Definition at line 613 of file GPMSA.C.

615 {
616  queso_require_less_msg(simulationId, m_simulationParameters.size(), "simulationId is too large");
617 
618  queso_require_msg(m_simulationParameters[simulationId], "vector is NULL");
619 
620  return *(this->m_simulationParameters[simulationId]);
621 }
std::vector< typename SharedPtr< V >::Type > m_simulationParameters
Definition: GPMSA.h:347
template<class V , class M >
const std::vector< typename SharedPtr< V >::Type > & QUESO::GPMSAFactory< V, M >::simulationParameters ( ) const

Return all points in parameterSpace for all simulations.

This returns all points in parameter space at which simulations were executed

Definition at line 625 of file GPMSA.C.

626 {
627  return this->m_simulationParameters;
628 }
std::vector< typename SharedPtr< V >::Type > m_simulationParameters
Definition: GPMSA.h:347
template<class V , class M >
const V & QUESO::GPMSAFactory< V, M >::simulationScenario ( unsigned int  simulationId) const

Return the point in scenarioSpace for simulation simulationId.

This returns the point in scenario space at which simulation simulationId was executed

Definition at line 594 of file GPMSA.C.

596 {
597  queso_require_less_msg(simulationId, m_simulationScenarios.size(), "simulationId is too large");
598 
599  queso_require_msg(m_simulationScenarios[simulationId], "vector is NULL");
600 
601  return *(this->m_simulationScenarios[simulationId]);
602 }
std::vector< typename SharedPtr< V >::Type > m_simulationScenarios
Definition: GPMSA.h:346
template<class V , class M >
const std::vector< typename SharedPtr< V >::Type > & QUESO::GPMSAFactory< V, M >::simulationScenarios ( ) const

Return all points in scenarioSpace for all simulations.

This returns all points in scenario space at which simulations were executed

Definition at line 606 of file GPMSA.C.

607 {
608  return this->m_simulationScenarios;
609 }
std::vector< typename SharedPtr< V >::Type > m_simulationScenarios
Definition: GPMSA.h:346

Friends And Related Function Documentation

template<class V = GslVector, class M = GslMatrix>
std::ostream& operator<< ( std::ostream &  os,
const GPMSAFactory< V, M > &  obj 
)
friend

Definition at line 327 of file GPMSA.h.

329  {
330  obj.print(os);
331  return os;
332  }

Member Data Documentation

template<class V = GslVector, class M = GslMatrix>
bool QUESO::GPMSAFactory< V, M >::allocated_m_opts
private

Definition at line 481 of file GPMSA.h.

Referenced by QUESO::GPMSAFactory< V, M >::GPMSAFactory().

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<M>::Type QUESO::GPMSAFactory< V, M >::BT_Wy_B_inv

Definition at line 474 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<BoxSubset<V, M> >::Type QUESO::GPMSAFactory< V, M >::discrepancyCorrelationDomain

Definition at line 413 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<V>::Type QUESO::GPMSAFactory< V, M >::discrepancyCorrelationMax

Definition at line 412 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<V>::Type QUESO::GPMSAFactory< V, M >::discrepancyCorrelationMin

Definition at line 411 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<VectorSpace<V, M> >::Type QUESO::GPMSAFactory< V, M >::discrepancyCorrelationSpace

Definition at line 410 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<BoxSubset<V, M> >::Type QUESO::GPMSAFactory< V, M >::discrepancyPrecisionDomain

Definition at line 407 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<V>::Type QUESO::GPMSAFactory< V, M >::discrepancyPrecisionMax

Definition at line 406 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<V>::Type QUESO::GPMSAFactory< V, M >::discrepancyPrecisionMin

Definition at line 405 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<BoxSubset<V, M> >::Type QUESO::GPMSAFactory< V, M >::emulatorCorrelationDomain

Definition at line 396 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<V>::Type QUESO::GPMSAFactory< V, M >::emulatorCorrelationMax

Definition at line 395 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<V>::Type QUESO::GPMSAFactory< V, M >::emulatorCorrelationMin

Definition at line 394 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<VectorSpace<V, M> >::Type QUESO::GPMSAFactory< V, M >::emulatorCorrelationSpace

Definition at line 393 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<BoxSubset<V, M> >::Type QUESO::GPMSAFactory< V, M >::emulatorDataPrecisionDomain

Definition at line 418 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<V>::Type QUESO::GPMSAFactory< V, M >::emulatorDataPrecisionMax

Definition at line 417 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<V>::Type QUESO::GPMSAFactory< V, M >::emulatorDataPrecisionMin

Definition at line 416 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<BoxSubset<V, M> >::Type QUESO::GPMSAFactory< V, M >::emulatorPrecisionDomain

Definition at line 390 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<V>::Type QUESO::GPMSAFactory< V, M >::emulatorPrecisionMax

Definition at line 389 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<V>::Type QUESO::GPMSAFactory< V, M >::emulatorPrecisionMin

Definition at line 388 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<VectorSpace<V, M> >::Type QUESO::GPMSAFactory< V, M >::emulatorPrecisionSpace

Definition at line 387 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<GPMSAEmulator<V, M> >::Type QUESO::GPMSAFactory< V, M >::gpmsaEmulator

Definition at line 453 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<M>::Type QUESO::GPMSAFactory< V, M >::K

Definition at line 469 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<M>::Type QUESO::GPMSAFactory< V, M >::KT_K_inv

Definition at line 477 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<M>::Type QUESO::GPMSAFactory< V, M >::m_BMatrix

Definition at line 466 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
bool QUESO::GPMSAFactory< V, M >::m_constructedGP

Definition at line 454 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
std::vector<typename SharedPtr<V>::Type> QUESO::GPMSAFactory< V, M >::m_discrepancyBases

Definition at line 355 of file GPMSA.h.

Referenced by QUESO::GPMSAFactory< V, M >::GPMSAFactory().

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<BetaVectorRV<V, M> >::Type QUESO::GPMSAFactory< V, M >::m_discrepancyCorrelationStrength

Definition at line 435 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<V>::Type QUESO::GPMSAFactory< V, M >::m_discrepancyCorrelationStrengthAlphaVec

Definition at line 447 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<V>::Type QUESO::GPMSAFactory< V, M >::m_discrepancyCorrelationStrengthBetaVec

Definition at line 448 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
std::vector<M> QUESO::GPMSAFactory< V, M >::m_discrepancyMatrices

Definition at line 464 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<GammaVectorRV<V, M> >::Type QUESO::GPMSAFactory< V, M >::m_discrepancyPrecision

Definition at line 434 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<V>::Type QUESO::GPMSAFactory< V, M >::m_discrepancyPrecisionScaleVec

Definition at line 446 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<V>::Type QUESO::GPMSAFactory< V, M >::m_discrepancyPrecisionShapeVec

Definition at line 445 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<BetaVectorRV<V, M> >::Type QUESO::GPMSAFactory< V, M >::m_emulatorCorrelationStrength

Definition at line 433 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<V>::Type QUESO::GPMSAFactory< V, M >::m_emulatorCorrelationStrengthAlphaVec

Definition at line 443 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<V>::Type QUESO::GPMSAFactory< V, M >::m_emulatorCorrelationStrengthBetaVec

Definition at line 444 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<GammaVectorRV<V, M> >::Type QUESO::GPMSAFactory< V, M >::m_emulatorDataPrecision

Definition at line 436 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<V>::Type QUESO::GPMSAFactory< V, M >::m_emulatorDataPrecisionScaleVec

Definition at line 450 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<V>::Type QUESO::GPMSAFactory< V, M >::m_emulatorDataPrecisionShapeVec

Definition at line 449 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<GammaVectorRV<V, M> >::Type QUESO::GPMSAFactory< V, M >::m_emulatorPrecision

Definition at line 431 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<V>::Type QUESO::GPMSAFactory< V, M >::m_emulatorPrecisionScaleVec

Definition at line 440 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<V>::Type QUESO::GPMSAFactory< V, M >::m_emulatorPrecisionShapeVec

Definition at line 439 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
const BaseEnvironment& QUESO::GPMSAFactory< V, M >::m_env

Definition at line 334 of file GPMSA.h.

Referenced by QUESO::GPMSAFactory< V, M >::GPMSAFactory().

template<class V = GslVector, class M = GslMatrix>
std::vector<typename SharedPtr<V>::Type> QUESO::GPMSAFactory< V, M >::m_experimentOutputs

Definition at line 350 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
const VectorSpace<V, M>& QUESO::GPMSAFactory< V, M >::m_experimentOutputSpace

Definition at line 341 of file GPMSA.h.

Referenced by QUESO::GPMSAFactory< V, M >::GPMSAFactory().

template<class V = GslVector, class M = GslMatrix>
std::vector<typename SharedPtr<V>::Type> QUESO::GPMSAFactory< V, M >::m_experimentScenarios

Definition at line 349 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
unsigned int QUESO::GPMSAFactory< V, M >::m_numExperimentAdds

Definition at line 361 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
unsigned int QUESO::GPMSAFactory< V, M >::m_numExperiments

Definition at line 344 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
unsigned int QUESO::GPMSAFactory< V, M >::m_numSimulationAdds

Definition at line 360 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
unsigned int QUESO::GPMSAFactory< V, M >::m_numSimulations

Definition at line 343 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<GammaVectorRV<V, M> >::Type QUESO::GPMSAFactory< V, M >::m_observationalPrecision

Definition at line 432 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<V>::Type QUESO::GPMSAFactory< V, M >::m_observationalPrecisionScaleVec

Definition at line 442 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<V>::Type QUESO::GPMSAFactory< V, M >::m_observationalPrecisionShapeVec

Definition at line 441 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
std::vector<typename SharedPtr<M>::Type> QUESO::GPMSAFactory< V, M >::m_observationErrorMatrices

Definition at line 357 of file GPMSA.h.

Referenced by QUESO::GPMSAFactory< V, M >::GPMSAFactory().

template<class V = GslVector, class M = GslMatrix>
SharedPtr<M>::Type QUESO::GPMSAFactory< V, M >::m_observationErrorMatrix

Definition at line 457 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
GPMSAOptions* QUESO::GPMSAFactory< V, M >::m_opts
private

Definition at line 482 of file GPMSA.h.

Referenced by QUESO::GPMSAFactory< V, M >::GPMSAFactory().

template<class V = GslVector, class M = GslMatrix>
const BaseVectorRV<V, M>& QUESO::GPMSAFactory< V, M >::m_parameterPrior

Definition at line 336 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
const VectorSpace<V, M>& QUESO::GPMSAFactory< V, M >::m_parameterSpace

Definition at line 339 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
const VectorSpace<V, M>& QUESO::GPMSAFactory< V, M >::m_scenarioSpace

Definition at line 338 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
std::vector<typename SharedPtr<V>::Type> QUESO::GPMSAFactory< V, M >::m_simulationOutputs

Definition at line 348 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
const VectorSpace<V, M>& QUESO::GPMSAFactory< V, M >::m_simulationOutputSpace

Definition at line 340 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
std::vector<typename SharedPtr<V>::Type> QUESO::GPMSAFactory< V, M >::m_simulationParameters

Definition at line 347 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
std::vector<typename SharedPtr<V>::Type> QUESO::GPMSAFactory< V, M >::m_simulationScenarios

Definition at line 346 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<ConcatenatedVectorRV<V, M> >::Type QUESO::GPMSAFactory< V, M >::m_totalPrior

Definition at line 437 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<M>::Type QUESO::GPMSAFactory< V, M >::m_TruncatedSVD_simulationOutputs

Definition at line 462 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<UniformVectorRV<V, M> >::Type QUESO::GPMSAFactory< V, M >::m_truncationErrorPrecision

Definition at line 430 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
unsigned int QUESO::GPMSAFactory< V, M >::num_svd_terms

Definition at line 376 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<BoxSubset<V, M> >::Type QUESO::GPMSAFactory< V, M >::observationalPrecisionDomain

Definition at line 402 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<V>::Type QUESO::GPMSAFactory< V, M >::observationalPrecisionMax

Definition at line 401 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<V>::Type QUESO::GPMSAFactory< V, M >::observationalPrecisionMin

Definition at line 400 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<VectorSpace<V, M> >::Type QUESO::GPMSAFactory< V, M >::observationalPrecisionSpace

Definition at line 399 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<VectorSpace<V, M> >::Type QUESO::GPMSAFactory< V, M >::oneDSpace

Definition at line 379 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
std::vector<const BaseVectorRV<V, M> *> QUESO::GPMSAFactory< V, M >::priors

Definition at line 427 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<V>::Type QUESO::GPMSAFactory< V, M >::residual

Definition at line 471 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<V>::Type QUESO::GPMSAFactory< V, M >::simulationOutputMeans

Definition at line 353 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<BoxSubset<V, M> >::Type QUESO::GPMSAFactory< V, M >::totalDomain

Definition at line 425 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<V>::Type QUESO::GPMSAFactory< V, M >::totalMaxs

Definition at line 423 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<V>::Type QUESO::GPMSAFactory< V, M >::totalMins

Definition at line 422 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<VectorSpace<V, M> >::Type QUESO::GPMSAFactory< V, M >::totalSpace

Definition at line 421 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<BoxSubset<V, M> >::Type QUESO::GPMSAFactory< V, M >::truncationErrorPrecisionDomain

Definition at line 384 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<V>::Type QUESO::GPMSAFactory< V, M >::truncationErrorPrecisionMax

Definition at line 383 of file GPMSA.h.

template<class V = GslVector, class M = GslMatrix>
ScopedPtr<V>::Type QUESO::GPMSAFactory< V, M >::truncationErrorPrecisionMin

Definition at line 382 of file GPMSA.h.


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

Generated on Tue Jun 5 2018 19:49:15 for queso-0.57.1 by  doxygen 1.8.5