Logarithm of the value of the scalar function.
97 double prodScenario = 1.0;
98 double prodParameter = 1.0;
99 double prodDiscrepancy = 1.0;
104 VectorSpace<V, M> gpSpace(this->
m_scenarioSpace.env(),
"", totalDim, NULL);
105 V residual(gpSpace.zeroVector());
106 M covMatrix(residual);
114 for (
unsigned int i = 0; i < totalDim; i++) {
115 for (
unsigned int j = 0; j < totalDim; j++) {
124 for (
unsigned int k = 0;
k < dimParameter;
k++) {
125 (*parameter1)[
k] = domainVector[
k];
135 if (j < this->m_numExperiments) {
138 for (
unsigned int k = 0;
k < dimParameter;
k++) {
139 (*parameter2)[
k] = domainVector[
k];
152 unsigned int emulatorCorrStrStart = dimParameter + 2;
153 for (
unsigned int k = 0;
k < dimScenario;
k++) {
154 prodScenario *= std::pow(domainVector[emulatorCorrStrStart+
k],
155 4.0 * ((*scenario1)[
k] - (*scenario2)[
k]) *
156 ((*scenario1)[k] - (*scenario2)[k]));
159 for (
unsigned int k = 0; k < dimParameter; k++) {
160 prodParameter *= std::pow(
161 domainVector[emulatorCorrStrStart+dimScenario+k],
162 4.0 * ((*parameter1)[k] - (*parameter2)[k]) *
163 ((*parameter1)[k] - (*parameter2)[k]));
166 double emPrecision = domainVector[dimParameter+1];
167 covMatrix(i, j) = prodScenario * prodParameter /
176 if (i < this->m_numExperiments && j < this->m_numExperiments) {
179 prodDiscrepancy = 1.0;
180 unsigned int discrepancyCorrStrStart = dimParameter +
183 for (
unsigned int k = 0; k < dimScenario; k++) {
184 prodDiscrepancy *= std::pow(domainVector[discrepancyCorrStrStart+k],
185 4.0 * ((*scenario1)[k] - (*scenario2)[k]) *
186 ((*scenario1)[k] - (*scenario2)[k]));
189 covMatrix(i, j) += prodDiscrepancy /
190 domainVector[discrepancyCorrStrStart-1];
199 unsigned int dimSum = 4 +
204 double nugget = 1.0 / domainVector[dimSum-1];
205 covMatrix(i, i) += nugget;
219 V sol(covMatrix.invertMultiply(residual));
222 double minus_2_log_lhd = 0.0;
223 for (
unsigned int i = 0; i < totalDim; i++) {
224 minus_2_log_lhd += sol[i] * residual[i];
227 return -0.5 * minus_2_log_lhd;
const std::vector< V * > & m_experimentScenarios
const std::vector< V * > & m_experimentOutputs
const std::vector< V * > & m_simulationOutputs
const M & m_experimentErrors
const unsigned int m_numSimulations
const std::vector< V * > & m_simulationScenarios
const std::vector< V * > & m_simulationParameters
const VectorSpace< V, M > & m_parameterSpace
const unsigned int m_numExperiments
const VectorSpace< V, M > & m_scenarioSpace