Loading...
Searching...
No Matches
Fang2017filter_wDF.C
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ██╗████████╗██╗ ██╗ █████╗ ██████╗ █████╗ ███████╗██╗ ██╗
3 ██║╚══██╔══╝██║ ██║██╔══██╗██╔════╝██╔══██╗ ██╔════╝██║ ██║
4 ██║ ██║ ███████║███████║██║ ███████║█████╗█████╗ ██║ ██║
5 ██║ ██║ ██╔══██║██╔══██║██║ ██╔══██║╚════╝██╔══╝ ╚██╗ ██╔╝
6 ██║ ██║ ██║ ██║██║ ██║╚██████╗██║ ██║ ██║ ╚████╔╝
7 ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═══╝
8
9 * In real Time Highly Advanced Computational Applications for Finite Volumes
10 * Copyright (C) 2017 by the ITHACA-FV authors
11-------------------------------------------------------------------------------
12
13 License
14 This file is part of ITHACA-FV
15
16 ITHACA-FV is free software: you can redistribute it and/or modify
17 it under the terms of the GNU Lesser General Public License as published by
18 the Free Software Foundation, either version 3 of the License, or
19 (at your option) any later version.
20
21 ITHACA-FV is distributed in the hope that it will be useful,
22 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 GNU Lesser General Public License for more details.
25
26 You should have received a copy of the GNU Lesser General Public License
27 along with ITHACA-FV. If not, see <http://www.gnu.org/licenses/>.
28
29\*---------------------------------------------------------------------------*/
30
31
34
35#include "Fang2017filter_wDF.H"
36
37namespace ITHACAmuq
38{
39// * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * //
40// Constructor
41Fang2017filter_wDF::Fang2017filter_wDF() {}
42Fang2017filter_wDF::Fang2017filter_wDF(int _Nsamples)
43{
44 Nsamples = _Nsamples;
45}
46
47// * * * * * * * * * * * * * * Filter Methods * * * * * * * * * * * * * * //
48
49// Return number of samples per ensamble
51{
52 return Nsamples;
53}
54
55// Return time
57{
58 return timeVector(timeStepI);
59}
60
61//--------------------------------------------------------------------------
63double Fang2017filter_wDF::getTime(int _timeStepI)
64{
65 return timeVector(_timeStepI);
66}
67
68//--------------------------------------------------------------------------
71{
72 return timeStepI;
73}
74
75//--------------------------------------------------------------------------
78{
79 return timeVector;
80}
81
82//--------------------------------------------------------------------------
85{
86 return stateMean;
87}
88
89//--------------------------------------------------------------------------
92{
93 return parameterMean;
94}
95
96//--------------------------------------------------------------------------
99{
100 return parameter_maxConf;
101}
102
103//--------------------------------------------------------------------------
106{
107 return parameter_minConf;
108}
109
110//--------------------------------------------------------------------------
112void Fang2017filter_wDF::setObservations(Eigen::MatrixXd _observations)
113{
114 observations = _observations;
115}
116
117//--------------------------------------------------------------------------
119void Fang2017filter_wDF::setTime(double _startTime, double _deltaTime,
120 double _endTime)
121{
122 M_Assert(_endTime > _startTime, "endTime must be bigger than startTime");
123 startTime = _startTime;
124 deltaTime = _deltaTime;
125 endTime = _endTime;
126 Ntimes = (endTime - startTime) / deltaTime;
127 Foam::Info << "startTime = " << startTime << Foam::endl;
128 Foam::Info << "endTime = " << endTime << Foam::endl;
129 Foam::Info << "deltaTime = " << deltaTime << Foam::endl;
130 Foam::Info << "Ntimes = " << Ntimes << Foam::endl;
131 timeVector = Eigen::VectorXd::LinSpaced(Ntimes + 1, startTime, endTime);
132}
133
134//--------------------------------------------------------------------------
136void Fang2017filter_wDF::setObservationTime(int _observationStart,
137 int _observationDelta)
138{
139 M_Assert(timeVector.size() > 0,
140 "Setup the timeVector before setting up the observations vector");
141 M_Assert(_observationStart > 0, "First observation timestep can't be 0");
142 observationStart = _observationStart;
143 observationDelta = _observationDelta;
144 Foam::Info << "First observation at time = " << timeVector(observationStart) << " s"
145 << Foam::endl;
146 Foam::Info << "Observations taken every " << observationDelta << " timesteps" << Foam::endl;
147 observationBoolVec = Eigen::VectorXi::Zero(timeVector.size() - 1);
148
149 for (int i = observationStart - 1; i < Ntimes; i += observationDelta)
150 {
151 observationBoolVec(i) = 1;
152 }
153}
154
155//--------------------------------------------------------------------------
157void Fang2017filter_wDF::setModelError(double cov, bool univariate)
158{
159 M_Assert(stateSize > 0, "Set the stateSize before setting up the model error");
160 Eigen::VectorXd modelError_mu;
161 Eigen::MatrixXd modelError_cov;
162
163 if (univariate)
164 {
165 modelError_mu = Eigen::VectorXd::Zero(1);
166 modelError_cov = Eigen::MatrixXd::Identity(1, 1) * cov;
167 }
168 else
169 {
170 modelError_mu = Eigen::VectorXd::Zero(stateSize);
171 modelError_cov = Eigen::MatrixXd::Identity(stateSize, stateSize) * cov;
172 }
173
174 modelErrorDensity = std::make_shared<muq::Modeling::Gaussian>(modelError_mu,
175 modelError_cov);
176 modelErrorFlag = 1;
177}
178
179//--------------------------------------------------------------------------
182{
183 M_Assert(observationSize > 0,
184 "Read measurements before setting up the measurement noise");
185 Eigen::VectorXd measNoise_mu = Eigen::VectorXd::Zero(observationSize);
186 Eigen::MatrixXd measNoise_cov = Eigen::MatrixXd::Identity(observationSize,
187 observationSize) * cov;
188 measNoiseDensity = std::make_shared<muq::Modeling::Gaussian>(measNoise_mu,
189 measNoise_cov);
190 measurementNoiseFlag = 1;
191}
192
193//--------------------------------------------------------------------------
196 Eigen::MatrixXd _cov, bool _univariateFlag)
197{
198 M_Assert(!(stateSize == 0 && _univariateFlag),
199 "If stateSize is not set you cannot use univariate InitialStateDensity");
200
201 if (_univariateFlag == 0)
202 {
203 if (stateSize == 0)
204 {
205 stateSize = _mean.size();
206 }
207 else
208 {
209 std::string message = "State has size = " + std::to_string(
210 stateSize) + " while input mean vector has size = " + std::to_string(
211 _mean.size());
212 M_Assert(stateSize == _mean.size(), message.c_str());
213 }
214
215 M_Assert(_cov.rows() == stateSize
216 && _cov.cols() == stateSize,
217 "To initialize the state ensemble use mean and cov with same dimentions");
218 }
219 else
220 {
221 univariateInitStateDensFlag = 1;
222 M_Assert(_mean.size() == 1,
223 "If univariateInitStateDensFlag is 1 mean size is 1");
224 M_Assert(_cov.size() == 1, "If univariateInitStateDensFlag is 1 cov size is 1");
225 }
226
227 initialStateDensity = std::make_shared<muq::Modeling::Gaussian>(_mean, _cov);
228 initialStateFlag = 1;
229}
230
231//--------------------------------------------------------------------------
234{
235 Foam::Info << "Setting initial state ensamble" << Foam::endl;
236 M_Assert(initialStateFlag == 1,
237 "Initialize the initial state density before sampling it");
238
239 if (univariateInitStateDensFlag)
240 {
241 M_Assert(stateSize > 0, "Set stateSize before sampleInitialState");
242 M_Assert(Nsamples > 0, "Set Nsamples before sampleInitialState");
243 Eigen::MatrixXd _stateEns(stateSize, Nsamples);
244
245 for (int i = 0; i < Nsamples; i++)
246 {
247 for (int j = 0; j < stateSize; j++)
248 {
249 _stateEns(j, i) = initialStateDensity->Sample()(0, 0);
250 }
251 }
252
253 stateEns.assignSamples(_stateEns);
254 }
255 else
256 {
257 stateEns.assignSamples(ensembleFromDensity(initialStateDensity));
258 }
259
260 Foam::Info << "debug: State ensamble size = " << stateEns.getSize() << Foam::endl;
261}
262
263//--------------------------------------------------------------------------
266 Eigen::MatrixXd _cov)
267{
268 if (parameterSize == 0)
269 {
270 parameterSize = _mean.size();
271 }
272 else
273 {
274 std::string message = "The input mean has size = " + std::to_string(
275 _mean.size()) + " but the parameterSize is " + std::to_string(parameterSize);
276 M_Assert(parameterSize == _mean.size(), message.c_str());
277 }
278
279 M_Assert(_cov.rows() == parameterSize
280 && _cov.cols() == parameterSize, "Use mean and cov with same dimentions");
281 parameterPriorMean = _mean;
282 parameterPriorCov = _cov;
283 parameterPriorDensity = std::make_shared<muq::Modeling::Gaussian>(_mean, _cov);
284 parameterPriorFlag = 1;
285}
286
287//--------------------------------------------------------------------------
290{
291 M_Assert(parameterPriorFlag == 1, "Set up the parameter prior density");
292 parameterEns.assignSamples(ensembleFromDensity(parameterPriorDensity));
293 parameterMean.col(timeStepI) = parameterEns.mean();
294}
295
296//--------------------------------------------------------------------------
299 std::shared_ptr<muq::Modeling::Gaussian> _density)
300{
301 M_Assert(Nsamples > 0, "Number of samples not set up correctly");
302 Eigen::MatrixXd output(_density->Sample().size(), Nsamples);
303
304 for (int i = 0; i < Nsamples; i++)
305 {
306 output.col(i) = _density->Sample();
307 }
308
309 return output;
310}
311
312
313//--------------------------------------------------------------------------
316{
317 Eigen::MatrixXd stateSamps = stateEns.getSamples();
318 Eigen::MatrixXd paramSamps = parameterEns.getSamples();
319 M_Assert(stateSamps.cols() == paramSamps.cols(),
320 "State and parameter ensambles must have same number of samples");
321 Eigen::MatrixXd temp(stateSamps.rows() + paramSamps.rows(), stateSamps.cols());
322 temp << stateSamps,
323 paramSamps;
324 jointEns.assignSamples(temp);
325}
326
327//--------------------------------------------------------------------------
329void Fang2017filter_wDF::setObservationSize(int _size)
330{
331 observationSize = _size;
332 Foam::Info << "Observation size = " << observationSize << Foam::endl;
333}
334
335//--------------------------------------------------------------------------
337void Fang2017filter_wDF::setStateSize(int _size)
338{
339 stateSize = _size;
340 Foam::Info << "State size = " << stateSize << Foam::endl;
341}
342
343//--------------------------------------------------------------------------
345int Fang2017filter_wDF::getStateSize()
346{
347 return stateSize;
348}
349
350//--------------------------------------------------------------------------
352void Fang2017filter_wDF::setParameterSize(int _size)
353{
354 parameterSize = _size;
355 Foam::Info << "Parameter size = " << parameterSize << Foam::endl;
356}
357
358//--------------------------------------------------------------------------
360int Fang2017filter_wDF::getParameterSize()
361{
362 return parameterSize;
363}
364
365//--------------------------------------------------------------------------
367void Fang2017filter_wDF::updateJointEns(Eigen::VectorXd _observation)
368{
369 M_Assert(_observation.size() == observationSize,
370 "Observation has wrong dimentions");
371 //TODO deal with invertibility of observationEns.cov()
372 int ensSize = jointEns.getSize();
373 Eigen::MatrixXd autoCovInverse = observationEns.cov().inverse();
374 Eigen::MatrixXd crossCov = jointEns.crossCov(observationEns.getSamples());
375
376 for (int i = 0; i < ensSize; i++)
377 {
378 Eigen::VectorXd newSamp = jointEns.getSample(i) + crossCov * autoCovInverse *
379 (_observation - observationEns.getSample(i));
380 jointEns.assignSample(i, newSamp);
381 }
382
383 // ################### Kabir:
384 // Calculate the condition numbers
385 double condAutoCovInverse = EigenFunctions::condNumber(autoCovInverse);
386 double condCrossCov = EigenFunctions::condNumber(crossCov);
387 Eigen::MatrixXd kalmanGain = crossCov *
388 autoCovInverse; // Calculate Kalman Gain
389 double condKalmanGain = EigenFunctions::condNumber(kalmanGain);
390 // Open the files in append mode
391 std::ofstream outputFileAutoCovInverse("condNumberAutoCovInverse.txt",
392 std::ios::app);
393 std::ofstream outputFileCrossCov("condNumberCrossCov.txt", std::ios::app);
394 std::ofstream outputKalmanGain("condNumberKalmanGain.txt", std::ios::app);
395 // Save the new condition numbers as rows
396 outputFileAutoCovInverse << condAutoCovInverse << "\n";
397 outputFileCrossCov << condCrossCov << "\n";
398 outputKalmanGain << condKalmanGain << "\n";
399 // Close the files
400 outputFileAutoCovInverse.close();
401 outputFileCrossCov.close();
402 outputKalmanGain.close();
403 // ################### Kabir:
404}
405
406
407//--------------------------------------------------------------------------
409void Fang2017filter_wDF::run(int innerLoopMax, word outputFolder)
410{
411 M_Assert(initialStateFlag == 1, "Set up the initial state density");
412 M_Assert(parameterPriorFlag == 1, "Set up the parameter prior density");
413 M_Assert(modelErrorFlag == 1, "Set up the model error");
414 M_Assert(measurementNoiseFlag == 1, "Set up the measurement noise");
415 M_Assert(stateSize > 0, "Set state size");
416 M_Assert(observationSize > 0, "Set observation size");
417 M_Assert(parameterSize > 0, "Set parameter size");
418 timeStepI = 0;
420 stateMean.resize(stateSize, Ntimes);
421 state_maxConf.resize(stateSize, Ntimes);
422 state_minConf.resize(stateSize, Ntimes);
423 parameter_maxConf.resize(parameterSize, Ntimes);
424 parameter_minConf.resize(parameterSize, Ntimes);
425 parameterMean.resize(parameterSize, Ntimes);
426
427 while (timeStepI < Ntimes)
428 {
429 Foam::Info << "timeStep " << timeStepI << Foam::endl;
430
431 if (timeStepI == 0)
432 {
433 setParameterPriorDensity(parameterPriorMean, parameterPriorCov);
434 Foam::Info << "debugInside: parameterPriorMean = " << parameterPriorMean << Foam::endl;
436 }
437 else
438 {
439 setParameterPriorDensity( parameterMean.col(timeStepI - 1), parameterPriorCov);
441 }
442
443 stateProjection();
444
445 if (observationBoolVec(timeStepI) ==
446 1) //There is a measurement for this timestep
447 {
448 innerLoopI = 0;
449
450 while (innerLoopI < innerLoopMax)
451 {
452 Foam::Info << "Inner loop " << innerLoopI << Foam::endl;
453 Foam::Info << "debug: param mean =\n" << parameterEns.mean() << Foam::endl;
454
455 if (innerLoopI > 0)
456 {
457 setParameterPriorDensity(parameterMean.col(timeStepI), parameterPriorCov);
459 Foam::Info << "\ndebug : parameterMean after loop =\n" << parameterMean.col(
460 timeStepI) << Foam::endl;
461 }
462
464 observeState();
465 updateJointEns( observations.col(observationBoolVec.head(
466 timeStepI + 1).sum() - 1));
467 parameterMean.col(timeStepI) = jointEns.mean().tail(parameterSize);
468 innerLoopI++;
469 }
470
471 // ################### Kabir: Exporting the Posterior ensemble of heat flux weights (after the analysis stage), ITHACAoutput/projection/HFWposterior0:2-HFWposterior98,
472 std::string WeightPosterior = "heatFlux_weightsPosterior";
473 std::string saveFileName = WeightPosterior; // + std::to_string(sampleI);
474 std::string folderName = "HFWposterior" + std::to_string(timeStepI);
475 std::string folderPath = "ITHACAoutput/projection/" + folderName;
476 // Eigen::Matrix<double, -1, -1> matrixKabirPost = parameterEns.getSamples(); // Incorrect parameterEns is prior
477 // Eigen::Matrix<double, -1, -1> matrixKabirPost = jointEns.tail(parameterSize).getSamples(); // InCorrect ITHACAmuq::ensemble class does not have the tail and head member functions
478 Eigen::Matrix < double, -1,
479 -1 > matrixKabirPost = jointEns.getSamples().bottomRows(parameterSize);
480 ITHACAstream::exportMatrix(matrixKabirPost, saveFileName, "eigen", folderPath);
481 // ################### Kabir: Exporting the Posterior ensemble of heat flux weights (after the analysis stage), ITHACAoutput/projection/HFWposterior0:2-HFWposterior98,
482 }
483 else //No measurement available
484 {
486 }
487
488 // Kabir: parameterEns and stateEns are the prior. After updating everything goes into the jointEns.
489 // So, jointEns consists of both posterior stateEns and parameterEns . We must calculate the quantiles or mean separately for posterior parameterEns and stateEns within posterior jointEns,
490 // we must indeed use head/topRows and tail/bottomRows, like the following.
491 parameterMean.col(timeStepI) = jointEns.mean().tail(
492 parameterSize); // [5,100]
493 stateMean.col(timeStepI) = jointEns.mean().head(
494 stateSize); // [3200,100]
495 //parameter_maxConf.col(timeStepI) = muq2ithaca::quantile(parameterEns.getSamples(), 0.95); // Incorrect, parameterEns is prior
496 //parameter_minConf.col(timeStepI) = muq2ithaca::quantile(parameterEns.getSamples(), 0.05); // Incorrect parameterEns is prior
497 //state_maxConf.col(timeStepI) = muq2ithaca::quantile(stateEns.getSamples(),0.95); // Incorrect stateEns is prior
498 //state_minConf.col(timeStepI) = muq2ithaca::quantile(stateEns.getSamples(), 0.05); // Incorrect stateEns is prior
499 //parameter_maxConf.col(timeStepI) = muq2ithaca::quantile(jointEns.getSamples().tail(parameterSize), 0.95); // Incorrect ITHACAmuq::ensemble class does not have the tail and head member functions
500 //parameter_minConf.col(timeStepI) = muq2ithaca::quantile(jointEns.getSamples().tail(parameterSize), 0.05); // Incorrect ITHACAmuq::ensemble class does not have the tail and head member functions
501 //state_maxConf.col(timeStepI) = muq2ithaca::quantile(jointEns.getSamples().head(stateSize), 0.95); // Incorrect ITHACAmuq::ensemble class does not have the tail and head member functions
502 //state_minConf.col(timeStepI) = muq2ithaca::quantile(jointEns.getSamples().head(stateSize), 0.05); // Incorrect ITHACAmuq::ensemble class does not have the tail and head member functions
503 //parameter_maxConf.col(timeStepI) = muq2ithaca::quantile(jointEns.getSamples().bottomRows(parameterSize), 0.95); // Incorrect ⏬
504 //parameter_minConf.col(timeStepI) = muq2ithaca::quantile(jointEns.getSamples().bottomRows(parameterSize), 0.05); // Incorrect ⏬
505 //state_maxConf.col(timeStepI) = muq2ithaca::quantile(jointEns.getSamples().topRows(stateSize), 0.95); // Incorrect ⏬
506 //state_minConf.col(timeStepI) = muq2ithaca::quantile(jointEns.getSamples().topRows(stateSize), 0.05); // Incorrect ⏬
507 // the compiler is unable to determine which quantile function to call because there are multiple candidates with
508 // the same name. This is known as an ambiguous call. To resolve the ambiguity, I should specify which version
509 // of the quantile function to call explicitly by providing the argument types. So, I specify that I call the
510 // quantile function that operates on a matrix of samples by explicitly casting the result of
511 // jointEns.getSamples().bottomRows(parameterSize) and jointEns.getSamples().topRows(stateSize) to Eigen::MatrixXd.
512 // By casting the result to Eigen::MatrixXd, I make it clear to the compiler which overload of the quantile function to use.
513 //
514 // the quantile function has two overloads:
515 //
516 // 1- double quantile(Eigen::VectorXd samps, double p, int method = 1);
517 // 2- Eigen::VectorXd quantile(Eigen::MatrixXd samps, double p, int method = 1);
518 //
519 // When you call muq2ithaca::quantile(jointEns.getSamples().bottomRows(parameterSize), 0.95);, the compiler sees that
520 // jointEns.getSamples().bottomRows(parameterSize) returns a type that could be either an Eigen::VectorXd or an Eigen::MatrixXd
521 // depending on the context. The compiler doesn't know which overload to choose because both overloads are viable options.
522 // By explicitly casting the result to Eigen::MatrixXd, the following, we can remove the ambiguity
523 // the explicit casting is used to disambiguate the function call and ensure the correct overload is selected by the compiler based on the specified argument type.
524 parameter_maxConf.col(timeStepI) = muq2ithaca::quantile(
525 static_cast<Eigen::MatrixXd>(jointEns.getSamples().bottomRows(parameterSize)),
526 0.95);
527 parameter_minConf.col(timeStepI) = muq2ithaca::quantile(
528 static_cast<Eigen::MatrixXd>(jointEns.getSamples().bottomRows(parameterSize)),
529 0.05);
530 state_maxConf.col(timeStepI) = muq2ithaca::quantile(
531 static_cast<Eigen::MatrixXd>(jointEns.getSamples().topRows(stateSize)), 0.95);
532 state_minConf.col(timeStepI) = muq2ithaca::quantile(
533 static_cast<Eigen::MatrixXd>(jointEns.getSamples().topRows(stateSize)), 0.05);
534 timeStepI++;
535 }
536
537 ITHACAstream::exportMatrix(parameterMean, "parameterMean", "eigen",
538 outputFolder);
539 ITHACAstream::exportMatrix(parameter_maxConf, "parameter_maxConf", "eigen",
540 outputFolder);
541 ITHACAstream::exportMatrix(parameter_minConf, "parameter_minConf", "eigen",
542 outputFolder);
543 ITHACAstream::exportMatrix(stateMean, "stateMean", "eigen", outputFolder);
544 ITHACAstream::exportMatrix(state_maxConf, "state_maxConf", "eigen",
545 outputFolder); // [3200,100]
546 ITHACAstream::exportMatrix(state_minConf, "state_minConf", "eigen",
547 outputFolder); // [3200,100]
548 //cnpy::save(state_maxConf, "state_maxConf.npy");
549 //cnpy::save(state_minConf, "state_minConf.npy");
550}
551}
Header file of the Fang2017filter_wDF class.
Eigen::MatrixXd parameter_minConf
parameter minimum confidence level
void setObservations(Eigen::MatrixXd _observations)
Set the observations matrix.
Eigen::MatrixXd parameter_maxConf
parameter maximum confidence level
void setMeasNoise(double cov)
Setup of the measurement noise distribution.
void run(int innerLoopMax, word outputFolder)
Run the filtering.
ensemble stateEns
State ensemble.
Eigen::MatrixXd getStateMean()
Return state mean.
Eigen::MatrixXd getParameterMaxConf()
Return parameter Max Confidence.
void setModelError(double cov, bool univariate=0)
Setup of the model error distribution.
void sampleInitialState()
Create initial state ensemble.
void setObservationTime(int _observationStart, int _observationDelta)
Setup the observation vector.
Eigen::MatrixXd getParameterMinConf()
Return parameter Min Confidence.
std::shared_ptr< muq::Modeling::Gaussian > measNoiseDensity
Measurement noise density.
ensemble jointEns
Joint state and parameter ensemble.
int getTimeStep()
Return timestep.
std::shared_ptr< muq::Modeling::Gaussian > modelErrorDensity
Model noise density.
void setParameterPriorDensity(Eigen::VectorXd _mean, Eigen::MatrixXd _cov)
Create parameter ensemble.
Eigen::MatrixXd ensembleFromDensity(std::shared_ptr< muq::Modeling::Gaussian > _density)
General class to sample from an input density.
void buildJointEns()
Concatenate state and parameter ensambles to create the joint ensamble.
ensemble parameterEns
Parameter ensemble.
Eigen::MatrixXd state_minConf
State minimum confidence level.
int getNumberOfSamples()
Return number of samples per ensamble.
void setInitialStateDensity(Eigen::VectorXd _mean, Eigen::MatrixXd _cov, bool _univariateFlag=0)
Create initial state ensemble.
void sampleParameterDist()
Create parameter ensemble.
Eigen::MatrixXd getParameterMean()
Return parameter mean.
ensemble observationEns
Observation ensemble.
void setTime(double _startTime, double _deltaTime, double _endTime)
Setup the time vector.
Eigen::MatrixXd state_maxConf
State maximum confidence level.
Eigen::VectorXd getTimeVector()
Return time vector.
T condNumber(Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &A)
Conditioning number of a dense matrix.
void exportMatrix(Eigen::Matrix< T, -1, dim > &matrix, word Name, word type, word folder)
Export the reduced matrices in numpy (type=python), matlab (type=matlab) and txt (type=eigen) format ...