ReFRACtor
max_a_posteriori.h
Go to the documentation of this file.
1 #ifndef MAX_A_POSTERIORI_H
2 #define MAX_A_POSTERIORI_H
3 #include <model_measure.h>
4 
5 namespace FullPhysics {
6 
7 //-----------------------------------------------------------------------
13 //-----------------------------------------------------------------------
14 
16  virtual public ModelMeasure {
17 
18 public:
19 
20 
21 //-----------------------------------------------------------------------
29 //-----------------------------------------------------------------------
30 
31  MaxAPosteriori(const blitz::Array<double, 1>& a_priori_params,
32  const blitz::Array<double, 2>& a_priori_cov);
33 
34 
35  virtual ~MaxAPosteriori() {}
36 
37 
38 //-----------------------------------------------------------------------
42 //-----------------------------------------------------------------------
43 
44  virtual blitz::Array<double, 1> a_priori_params() const
45  { return Xa.copy(); }
46 
47 
48 //-----------------------------------------------------------------------
52 //-----------------------------------------------------------------------
53 
54  virtual blitz::Array<double, 2> a_priori_cov() const
55  { return Sa.copy(); }
56 
57 
58 //-----------------------------------------------------------------------
60 //-----------------------------------------------------------------------
61 
62  virtual void print(std::ostream& Os) const
63  { Os << "MaxAPosteriori"; }
64 
65 
66 //-----------------------------------------------------------------------
67 //-----------------------------------------------------------------------
68 // The following public methods are for convenience.
69 //-----------------------------------------------------------------------
70 //-----------------------------------------------------------------------
71 
72 
73 //-----------------------------------------------------------------------
92 //-----------------------------------------------------------------------
93 
94  virtual blitz::Array<double, 1> parameter_a_priori_diff() const
95  { return blitz::Array<double, 1>(X-Xa); }
96 
97 
98 //-----------------------------------------------------------------------
133 //-----------------------------------------------------------------------
134 
135  virtual blitz::Array<double, 1> cov_weighted_parameter_a_priori_diff() const;
136 
137 
138 //-----------------------------------------------------------------------
161 //-----------------------------------------------------------------------
162 
163  virtual blitz::Array<double, 2> a_priori_cov_chol_inv() const
164  { return Sa_chol_inv.copy(); }
165 
166 
167 //-----------------------------------------------------------------------
168 //-----------------------------------------------------------------------
169 // The following are secondary convenient public methods.
170 //-----------------------------------------------------------------------
171 //-----------------------------------------------------------------------
172 
173 
174 //-----------------------------------------------------------------------
205 //-----------------------------------------------------------------------
206 
207  virtual blitz::Array<double, 1> model_measure_diff_aug();
208 
209 
210 //-----------------------------------------------------------------------
252 //-----------------------------------------------------------------------
253 
254  virtual blitz::Array<double, 1> weighted_model_measure_diff_aug();
255 
256 
257 //-----------------------------------------------------------------------
301 //-----------------------------------------------------------------------
302 
303  virtual blitz::Array<double, 2> weighted_jacobian_aug();
304 
305 
306 //-----------------------------------------------------------------------
307 //-----------------------------------------------------------------------
308 // The following are tertiary convenient public methods.
309 //-----------------------------------------------------------------------
310 //-----------------------------------------------------------------------
311 
312 
313 //-----------------------------------------------------------------------
351 //-----------------------------------------------------------------------
352 
353  virtual blitz::Array<double, 2> a_posteriori_covariance();
354 
355 
356 //-----------------------------------------------------------------------
375 //-----------------------------------------------------------------------
376 
377  virtual blitz::Array<double, 2> averaging_kernel();
378 
379 
380 //-----------------------------------------------------------------------
381 //-----------------------------------------------------------------------
382 // More convenient methods for error analysis
383 //-----------------------------------------------------------------------
384 //-----------------------------------------------------------------------
385 
386 
387 //-----------------------------------------------------------------------
405 //-----------------------------------------------------------------------
406 
407  virtual blitz::Array<double, 2> a_priori_cov_chol() const
408  { return Sa_chol.copy(); }
409 
410 
411 //-----------------------------------------------------------------------
421 //-----------------------------------------------------------------------
422 
423  virtual blitz::Array<double, 1> param_a_priori_uncertainty() const;
424 
425 
426 //-----------------------------------------------------------------------
440 //-----------------------------------------------------------------------
441  virtual blitz::Array<double, 1> param_a_posteriori_uncertainty();
442 
443 
444 protected:
445 
446  blitz::Array<double, 1> Xa;
447  blitz::Array<double, 2> Sa;
448 
449  // For convenience
450  blitz::Array<double, 2> Sa_chol;
451  blitz::Array<double, 2> Sa_chol_inv;
452 
453 
454 };
455 }
456 #endif
virtual blitz::Array< double, 2 > weighted_jacobian_aug()
Returns the matrix returned by uncert_weighted_jacobian() augmented at the bottom by the matrix retur...
virtual blitz::Array< double, 2 > a_priori_cov_chol() const
Returns the Cholesky decomposition of the a-priori covariance matrix.
blitz::Array< double, 2 > Sa_chol_inv
virtual blitz::Array< double, 1 > cov_weighted_parameter_a_priori_diff() const
Returns the current parameters value and their a priori value difference (current param - a priori pa...
blitz::Array< double, 1 > X
virtual blitz::Array< double, 2 > a_priori_cov() const
Returns the a priori covariance matrix.
virtual blitz::Array< double, 1 > model_measure_diff_aug()
Returns the vector returned by model_measure_diff() augmented at the bottom by the vector returned by...
MaxAPosteriori(const blitz::Array< double, 1 > &a_priori_params, const blitz::Array< double, 2 > &a_priori_cov)
Constructor.
virtual blitz::Array< double, 1 > weighted_model_measure_diff_aug()
Returns the vector returned by uncert_weighted_model_measure_diff() augmented at the bottom by the ve...
blitz::Array< double, 2 > Sa
virtual void print(std::ostream &Os) const
Prints description of object.
blitz::Array< double, 1 > Xa
virtual blitz::Array< double, 2 > a_posteriori_covariance()
Returns a-posteriori covariance matrix.
The base class for models and measurements.
Definition: model_measure.h:46
The base class for maximum a posteriori estimation.
virtual blitz::Array< double, 2 > a_priori_cov_chol_inv() const
Returns the inverse of the Cholesky decomposition of the a priori covariance matrix.
virtual blitz::Array< double, 1 > a_priori_params() const
Returns the a priori values (knowledge) of the parameters.
virtual blitz::Array< double, 1 > parameter_a_priori_diff() const
Returns the current parameters value and their a priori value difference (current param - a priori pa...
Contains classes to abstract away details in various Spurr Radiative Transfer software.
Definition: doxygen_python.h:1
virtual blitz::Array< double, 1 > param_a_priori_uncertainty() const
Returns the square root of the diagonal of the a-priori covariance matrix.
virtual blitz::Array< double, 1 > param_a_posteriori_uncertainty()
Returns the square root of the diagonal of the a-posteriori covariance matrix.
blitz::Array< double, 2 > Sa_chol
virtual blitz::Array< double, 2 > averaging_kernel()
Returns the averaging kernel matrix.

Copyright © 2017, California Institute of Technology.
ALL RIGHTS RESERVED.
U.S. Government Sponsorship acknowledged.
Generated Fri Aug 24 2018 15:44:10