ReFRACtor
FullPhysics::MaxAPosteriori Class Referenceabstract

The base class for maximum a posteriori estimation. More...

#include <max_a_posteriori.h>

+ Inheritance diagram for FullPhysics::MaxAPosteriori:
+ Collaboration diagram for FullPhysics::MaxAPosteriori:

Public Member Functions

 MaxAPosteriori (const blitz::Array< double, 1 > &a_priori_params, const blitz::Array< double, 2 > &a_priori_cov)
 Constructor. More...
 
virtual ~MaxAPosteriori ()
 
virtual blitz::Array< double, 2 > a_posteriori_covariance ()
 Returns a-posteriori covariance matrix. More...
 
virtual blitz::Array< double, 2 > a_priori_cov () const
 Returns the a priori covariance matrix. More...
 
virtual blitz::Array< double, 2 > a_priori_cov_chol () const
 Returns the Cholesky decomposition of the a-priori covariance matrix. More...
 
virtual blitz::Array< double, 2 > a_priori_cov_chol_inv () const
 Returns the inverse of the Cholesky decomposition of the a priori covariance matrix. More...
 
virtual blitz::Array< double, 1 > a_priori_params () const
 Returns the a priori values (knowledge) of the parameters. More...
 
virtual void assert_jacobian_correct (const blitz::Array< double, 2 > &k) const
 Conditions that must be satisfied when a derived class computes the Jacobian of the model. More...
 
virtual void assert_model_correct (const blitz::Array< double, 1 > &m) const
 Conditions that must be satisfied when a derived class computes the model. More...
 
virtual void assert_parameter_correct (const blitz::Array< double, 1 > &x) const
 Checks that the new input parameters are correct. More...
 
virtual void assert_parameter_set_correctly () const
 Checks that the parameters are set correctly. More...
 
virtual blitz::Array< double, 2 > averaging_kernel ()
 Returns the averaging kernel matrix. More...
 
virtual void clear ()
 Deletes data contents. More...
 
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 param) weighted by the inverse of the Cholesky decomposition of the a priori covariance matrix. More...
 
virtual int expected_parameter_size () const
 Returns the expected size of the parameters. More...
 
bool jacobean_computed () const
 A boolean function to check whether or not the Jacobean of the model is computed. More...
 
virtual blitz::Array< double, 2 > jacobian ()
 Evaluates and returns the Jacobian of the model at the currently set parameter values. More...
 
virtual void jacobian_eval ()=0
 Evaluates the Jacobian of the model at the currently set parameter values. More...
 
virtual blitz::Array< double, 2 > jacobian_x (const blitz::Array< double, 1 > &x)
 The model Jacobian with parameters. More...
 
virtual blitz::Array< double, 1 > measurement () const
 Returns the measured data, to which the model is fit. More...
 
virtual blitz::Array< double, 1 > measurement_error_cov () const
 Returns the measurement error covariance (implemented as a diagonal matrix). More...
 
virtual int measurement_size () const
 Returns the size of the measurement data vector. More...
 
virtual blitz::Array< double, 1 > model ()
 Evaluates and returns the model at the currently set parameter values. More...
 
bool model_computed () const
 A boolean function to check whether or not the model is computed. More...
 
virtual void model_eval ()=0
 Evaluates the model at the currently set parameter values. More...
 
virtual void model_jacobian (blitz::Array< double, 1 > &m, blitz::Array< double, 2 > &k)
 Evaluates model and its Jacobian together. More...
 
virtual void model_jacobian_eval ()
 Evaluates the model and its Jacobian at the currently set parameter values. More...
 
virtual void model_jacobian_x (const blitz::Array< double, 1 > &x, blitz::Array< double, 1 > &m, blitz::Array< double, 2 > &k)
 Model and its Jacobian with parameters. More...
 
virtual blitz::Array< double, 1 > model_measure_diff ()
 Returns model and measurement difference (model - measurement) More...
 
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 parameter_a_priori_diff() More...
 
virtual blitz::Array< double, 1 > model_x (const blitz::Array< double, 1 > &x)
 The model function with parameters. More...
 
virtual blitz::Array< double, 1 > param_a_posteriori_uncertainty ()
 Returns the square root of the diagonal of the a-posteriori covariance matrix. More...
 
virtual blitz::Array< double, 1 > param_a_priori_uncertainty () const
 Returns the square root of the diagonal of the a-priori covariance matrix. More...
 
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 param) More...
 
virtual int parameter_size () const
 Returns the size of the parameters. More...
 
virtual void parameters (const blitz::Array< double, 1 > &x)
 Sets the problem at a new point in the parameter space. More...
 
virtual blitz::Array< double, 1 > parameters () const
 Returns the current parameters. More...
 
virtual bool parameters_different (const blitz::Array< double, 1 > &x) const
 Checks whether or not new input parameters are different from the current ones. More...
 
virtual void print (std::ostream &Os) const
 Prints description of object. More...
 
std::string print_to_string () const
 Print to string. More...
 
virtual void set (const ModelState &s)
 Makes self a copy of the input state. More...
 
virtual void set (const ProblemState &s)
 Makes self a copy of the input state. More...
 
void set_measurement (const blitz::Array< double, 1 > &measurement, const blitz::Array< double, 1 > &measurement_error_cov)
 For setting measurement and the error covariance matrix. More...
 
virtual blitz::Array< double, 2 > uncert_weighted_jac_inner_product ()
 Returns the inner product of the matrix returned by the method uncert_weighted_jacobian() by itself. More...
 
virtual blitz::Array< double, 2 > uncert_weighted_jacobian ()
 Returns the model Jacobian weighted by the inverse of the Cholesky decomposition of the error covariance matrix. More...
 
virtual blitz::Array< double, 1 > uncert_weighted_model_measure_diff ()
 Returns model and measurement difference weighted by the inverse of the Cholesky decomposition of the error covariance matrix. More...
 
virtual blitz::Array< double, 2 > weighted_jacobian_aug ()
 Returns the matrix returned by uncert_weighted_jacobian() augmented at the bottom by the matrix returned by a_priori_cov_chol_inv() More...
 
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 vector returned by cov_weighted_parameter_a_priori_diff() More...
 

Protected Attributes

blitz::Array< double, 2 > K
 
blitz::Array< double, 1 > M
 
blitz::Array< double, 1 > msrmnt
 
blitz::Array< double, 2 > Sa
 
blitz::Array< double, 2 > Sa_chol
 
blitz::Array< double, 2 > Sa_chol_inv
 
blitz::Array< double, 1 > Se
 
blitz::Array< double, 1 > Se_chol
 
blitz::Array< double, 1 > X
 
blitz::Array< double, 1 > Xa
 

Detailed Description

The base class for maximum a posteriori estimation.

This class is the base class for all classes that use maximum a posteriori estimation method to implement the problem of estimating the parameters of a statistical model.

Definition at line 15 of file max_a_posteriori.h.

Constructor & Destructor Documentation

◆ MaxAPosteriori()

MaxAPosteriori::MaxAPosteriori ( const blitz::Array< double, 1 > &  a_priori_params,
const blitz::Array< double, 2 > &  a_priori_cov 
)

Constructor.

Parameters
[in]a_priori_paramsA priori knowledge on the parameters
[in]a_priori_covA priori covariance matrix

Definition at line 20 of file max_a_posteriori.cc.

◆ ~MaxAPosteriori()

virtual FullPhysics::MaxAPosteriori::~MaxAPosteriori ( )
inlinevirtual

Definition at line 35 of file max_a_posteriori.h.

Member Function Documentation

◆ a_posteriori_covariance()

Array< double, 2 > MaxAPosteriori::a_posteriori_covariance ( )
virtual

Returns a-posteriori covariance matrix.

After the parameters of the model are retrieved such that the model is fitted to the measurement data, then a call to this method returns the a-posteriori covariance matrix.

Assume the following:

  • K (computed model Jacobian)
  • Se (measurement error covariance matrix)
  • Sa (a priori covariance matrix)
  • J (the matrix returned by weighted_jacobian_aug())

Then this method returns

\[ (J^TJ)^{-1} = \left( K^T S_e^{-1} K + S_a^{-1} \right)^{-1}. \]

In the context of the Non-Linear Least Squares (NLLS) problem, where J is the Jacobian of the NLLS problem,

\[ (J^TJ)^{-1} \]

is known as the best fit covariance.

I am not sure where the best location to implement this method is. Maybe it is better to rename it best_fit_covariance() and add to the class NLLSProblem as a method. Or, maybe there are two different perspectives of the same thing:

  • a-posteriori covariance
  • best fit covariance

If two perspectives, then perhaps it is best to keep a_posteriori_covariance() method here, and also implement best_fit_covariance() as a member of NLLSProblem class. If we decide to implement both methods, there will not be a lot of duplicate code because the body of a_posteriori_covariance() is just a function call.

Returns
A-posteriori covariance matrix

Definition at line 76 of file max_a_posteriori.cc.

◆ a_priori_cov()

virtual blitz::Array<double, 2> FullPhysics::MaxAPosteriori::a_priori_cov ( ) const
inlinevirtual

Returns the a priori covariance matrix.

Returns
The a priori covariance matrix

Definition at line 54 of file max_a_posteriori.h.

◆ a_priori_cov_chol()

virtual blitz::Array<double, 2> FullPhysics::MaxAPosteriori::a_priori_cov_chol ( ) const
inlinevirtual

Returns the Cholesky decomposition of the a-priori covariance matrix.

Assume

  • Sa (a priori covariance matrix)

Then the Cholesky decomposition of the a priori covariance matrix is

\[ S_a = C_a C_a^T \]

and this method returns

\[ C_a \]

Returns
The Cholesky decomposition of the a-priori covariance matrix

Definition at line 407 of file max_a_posteriori.h.

◆ a_priori_cov_chol_inv()

virtual blitz::Array<double, 2> FullPhysics::MaxAPosteriori::a_priori_cov_chol_inv ( ) const
inlinevirtual

Returns the inverse of the Cholesky decomposition of the a priori covariance matrix.

Let the following be the a priori covariance matrix:

  • Sa

Then the Cholesky decomposition of the a priori covariance matrix is

\[ S_a = C_a C_a^T \]

and this method returns

\[ C_a^{-1} \]

The method cov_weighted_parameter_a_priori_diff() is the implementation of a function of the parameters and the method a_priori_cov_chol_inv() is the Jacobian of cov_weighted_parameter_a_priori_diff().

Returns
The inverse of the Cholesky decomposition of the a priori covariance matrix

Definition at line 163 of file max_a_posteriori.h.

◆ a_priori_params()

virtual blitz::Array<double, 1> FullPhysics::MaxAPosteriori::a_priori_params ( ) const
inlinevirtual

Returns the a priori values (knowledge) of the parameters.

Returns
The a priori values (knowledge) of the parameters

Definition at line 44 of file max_a_posteriori.h.

◆ assert_jacobian_correct()

void ModelMeasure::assert_jacobian_correct ( const blitz::Array< double, 2 > &  k) const
virtualinherited

Conditions that must be satisfied when a derived class computes the Jacobian of the model.

This method is just the implementation of some conditions that must be satisfied after a derived class computes the Jacobian of the model. The derived class itself calls this method to check the computed Jacobian.

Parameters
[in]kThe computed model

Definition at line 35 of file model_measure.cc.

◆ assert_model_correct()

void ModelMeasure::assert_model_correct ( const blitz::Array< double, 1 > &  m) const
virtualinherited

Conditions that must be satisfied when a derived class computes the model.

This method is just the implementation of some conditions that must be satisfied after a derived class computes the model. The derived class itself calls this method to check the computed model.

Parameters
[in]mThe computed model

Definition at line 28 of file model_measure.cc.

◆ assert_parameter_correct()

void ProblemState::assert_parameter_correct ( const blitz::Array< double, 1 > &  x) const
virtualinherited

Checks that the new input parameters are correct.

This method checks to see whether or not the new input parameters are correct. If the parameters are not correct then it throws an exception.

Definition at line 44 of file problem_state.cc.

◆ assert_parameter_set_correctly()

virtual void FullPhysics::ProblemState::assert_parameter_set_correctly ( ) const
inlinevirtualinherited

Checks that the parameters are set correctly.

This method checks to see whether or not the parameters are set correctly. If the parameters are not set correctly then it throws an exception.

Definition at line 197 of file problem_state.h.

◆ averaging_kernel()

Array< double, 2 > MaxAPosteriori::averaging_kernel ( )
virtual

Returns the averaging kernel matrix.

This is another method that I am not sure about the best location for it. I chose it to be a method of this class because the class has all the data necessary to compute the averaging kernel.

Assume the following:

  • K (computed model Jacobian)
  • Se (measurement error covariance matrix)
  • Sa (a priori covariance matrix)

Then the averaging kernel is

\[ \left( K^T S_e^{-1} K + S_a^{-1} \right)^{-1} K^T S_e^{-1} K \]

Returns
The averaging kernel matrix

Definition at line 91 of file max_a_posteriori.cc.

◆ clear()

virtual void FullPhysics::ModelState::clear ( )
inlinevirtualinherited

Deletes data contents.

This method deletes state. If needed, it must be reimplemented by other classes derived from this class to delete other saved components associated with the state as well.

Reimplemented from FullPhysics::ProblemState.

Definition at line 84 of file model_state.h.

◆ cov_weighted_parameter_a_priori_diff()

Array< double, 1 > MaxAPosteriori::cov_weighted_parameter_a_priori_diff ( ) const
virtual

Returns the current parameters value and their a priori value difference (current param - a priori param) weighted by the inverse of the Cholesky decomposition of the a priori covariance matrix.

This method is for convenience. It returns the current parameters value and their a priori value difference weighted by the inverse of the Cholesky decomposition of the a priori covariance matrix.

This method does not have a good name. The "cov_weighted" portion of its name suggests that the difference is weighted by the a priori covariance matrix, but it is weighted by the inverse of the Cholesky decomposition of the covariance matrix.

Let the following be the current parameters value, the parameters a priori value, and the a priori covariance matrix respectively:

  • X
  • Xa
  • Sa

Then the Cholesky decomposition of the a priori covariance matrix is

\[ S_a = C_a C_a^T \]

and this method returns

\[ C_a^{-1}(X-X_a) \]

Returns
The current parameters value and their a priori value difference (current param - a priori param) weighted by the inverse of the Cholesky decomposition of the a priori covariance matrix

Definition at line 36 of file max_a_posteriori.cc.

◆ expected_parameter_size()

virtual int FullPhysics::ProblemState::expected_parameter_size ( ) const
inlinevirtualinherited

Returns the expected size of the parameters.

This method must be reimplemented by the problem class the inherits ProblemState. It is only in the context of an optimization problem that one knows what the size of the parameters (number of the dimensions of the parameter space) is.

This method is intentionally implemented here instead of being left as a pure virtual method. The intention is that the user to be able to create an object of this class or its derived classes for the purpose of preserving an older state of a problem if needed.

Returns
Expected size of parameters

Reimplemented in FullPhysics::NLLSMaxAPosteriori, FullPhysics::NLLSMaxLikelihood, FullPhysics::NLLSProblemScaled, FullPhysics::ModelMeasureStandard, FullPhysics::ModelMeasureBard, FullPhysics::ModelMeasureMeyer, FullPhysics::FmNLLSProblem, FullPhysics::BardNLLSProblem, FullPhysics::BrownNLLSProblem, FullPhysics::FreudensteinRothNLLSProblem, FullPhysics::HelicalValleyNLLSProblem, FullPhysics::JennrichSampsonNLLSProblem, FullPhysics::MeyerNLLSProblem, FullPhysics::PowellNLLSProblem, FullPhysics::PowellSingularNLLSProblem, and FullPhysics::Rosenbrock2NLLSProblem.

Definition at line 185 of file problem_state.h.

◆ jacobean_computed()

bool FullPhysics::ModelMeasure::jacobean_computed ( ) const
inlineinherited

A boolean function to check whether or not the Jacobean of the model is computed.

Returns
true if Jacobean is computed false otherwise

Definition at line 367 of file model_measure.h.

◆ jacobian()

virtual blitz::Array<double, 2> FullPhysics::ModelMeasure::jacobian ( )
inlinevirtualinherited

Evaluates and returns the Jacobian of the model at the currently set parameter values.

All the comments on jacobian_eval() method also apply to this method, and in addition this method returns the evaluated Jacobian.

The sizes of the Jacobian matrix can be obtained in advance:

Returns
Evaluated model Jacobian at the current point

Definition at line 190 of file model_measure.h.

◆ jacobian_eval()

virtual void FullPhysics::ModelMeasure::jacobian_eval ( )
pure virtualinherited

Evaluates the Jacobian of the model at the currently set parameter values.

This method must be implemented by the classes derived from this class.

The parameters (the point in the parameter space) must have already been set before calling this method. The parameters are already set if one of the following methods is already called successfully:

If the parameters are already set, then this method evaluate the Jacobian of the model at the currently set parameter values (point in the parameter space).

Implemented in FullPhysics::ModelMeasureStandard, FullPhysics::ModelMeasureBard, and FullPhysics::ModelMeasureMeyer.

◆ jacobian_x()

virtual blitz::Array<double, 2> FullPhysics::ModelMeasure::jacobian_x ( const blitz::Array< double, 1 > &  x)
inlinevirtualinherited

The model Jacobian with parameters.

This method also evaluates the Jacobian; however, it sets the model at the input new point and then evaluates its Jacobian.

The sizes of the Jacobian matrix can be obtained in advance:

Parameters
[in]xNew set of parameters
Returns
Evaluated model Jacobian at the input new point

Definition at line 211 of file model_measure.h.

◆ measurement()

virtual blitz::Array<double, 1> FullPhysics::ModelMeasure::measurement ( ) const
inlinevirtualinherited

Returns the measured data, to which the model is fit.

Returns
The measurement vector.

Definition at line 283 of file model_measure.h.

◆ measurement_error_cov()

virtual blitz::Array<double, 1> FullPhysics::ModelMeasure::measurement_error_cov ( ) const
inlinevirtualinherited

Returns the measurement error covariance (implemented as a diagonal matrix).

Returns
The measurement error covariance.

Definition at line 294 of file model_measure.h.

◆ measurement_size()

virtual int FullPhysics::ModelMeasure::measurement_size ( ) const
inlinevirtualinherited

Returns the size of the measurement data vector.

This method returns the size of the measured data vector. The following must also be equal to the value returned by measurement_size():

  • The size of the model data
  • The number of the rows of the model Jacobian
  • The number of the diagonal elements of the error covariance matrix
Returns
The size of the measurement data vector

Definition at line 312 of file model_measure.h.

◆ model()

virtual blitz::Array<double, 1> FullPhysics::ModelMeasure::model ( )
inlinevirtualinherited

Evaluates and returns the model at the currently set parameter values.

All the comments on model_eval() method also apply to this method, and in addition this method returns the evaluated model.

The size of the model vector can be obtained in advance by calling measurement_size().

Returns
Evaluated model at the current point

Definition at line 128 of file model_measure.h.

◆ model_computed()

bool FullPhysics::ModelMeasure::model_computed ( ) const
inlineinherited

A boolean function to check whether or not the model is computed.

Returns
true if model is computed false otherwise

Definition at line 356 of file model_measure.h.

◆ model_eval()

virtual void FullPhysics::ModelMeasure::model_eval ( )
pure virtualinherited

Evaluates the model at the currently set parameter values.

This method must be implemented by the classes derived from this class.

The parameters (the point in the parameter space) must have already been set before calling this method. The parameters are already set if one of the following methods is already called successfully:

If the parameters are already set, then this method evaluate the model at the currently set parameter values (point in the parameter space).

Implemented in FullPhysics::ModelMeasureStandard, FullPhysics::ModelMeasureBard, and FullPhysics::ModelMeasureMeyer.

◆ model_jacobian()

virtual void FullPhysics::ModelMeasure::model_jacobian ( blitz::Array< double, 1 > &  m,
blitz::Array< double, 2 > &  k 
)
inlinevirtualinherited

Evaluates model and its Jacobian together.

All the comments on model_jacobian_eval() method also apply to this method, and in addition this method passes to the caller the evaluated model and its Jacobian.

Parameters
[out]mThe model
[out]kThe Jacobian of the model

Definition at line 251 of file model_measure.h.

◆ model_jacobian_eval()

virtual void FullPhysics::ModelMeasure::model_jacobian_eval ( )
inlinevirtualinherited

Evaluates the model and its Jacobian at the currently set parameter values.

The parameters (the point in the parameter space) must have already been set before calling this method. The parameters are already set if one of the following methods is already called successfully:

If the parameters are already set, then this method evaluate the model and its Jacobian at the currently set parameter values (point in the parameter space).

Reimplemented in FullPhysics::ModelMeasureStandard, FullPhysics::ModelMeasureBard, and FullPhysics::ModelMeasureMeyer.

Definition at line 233 of file model_measure.h.

◆ model_jacobian_x()

virtual void FullPhysics::ModelMeasure::model_jacobian_x ( const blitz::Array< double, 1 > &  x,
blitz::Array< double, 1 > &  m,
blitz::Array< double, 2 > &  k 
)
inlinevirtualinherited

Model and its Jacobian with parameters.

This method passes to the caller the evaluated model and its Jacobian after setting the problem at the input new point.

Parameters
[in]xNew set of parameters
[out]mThe model
[out]kThe Jacobian of the model

Definition at line 272 of file model_measure.h.

◆ model_measure_diff()

virtual blitz::Array<double, 1> FullPhysics::ModelMeasure::model_measure_diff ( )
inlinevirtualinherited

Returns model and measurement difference (model - measurement)

This method is for convenience. It returns the difference of the computed model and the measurement. The difference is not called residual on purpose. The term residual will be used in the context of the Non-Linear (or Linear) Least Squares optimization.

Let the following be the computed model and the measured data respectively

  • M
  • S

Then this method returns

\[ M - S \]

Returns
Model and measurement difference (model - measurement)

Definition at line 410 of file model_measure.h.

◆ model_measure_diff_aug()

Array< double, 1 > MaxAPosteriori::model_measure_diff_aug ( )
virtual

Returns the vector returned by model_measure_diff() augmented at the bottom by the vector returned by parameter_a_priori_diff()

This method is for convenience. It returns an augmented vector. The vectors returned by the following methods appear at the top and at the bottom of the augmented vector respectively:

Let the following be the computed model, the measured data, the current parameters value, and the parameters a priori value respectively:

  • M
  • S
  • X
  • Xa

Then this method returns

\[ \left[ \begin{array}{c} M - S ---- X - X_a \end{array} \right] \]

Returns
The vector returned by model_measure_diff() augmented at the bottom by the vector returned by parameter_a_priori_diff()

Definition at line 43 of file max_a_posteriori.cc.

◆ model_x()

virtual blitz::Array<double, 1> FullPhysics::ModelMeasure::model_x ( const blitz::Array< double, 1 > &  x)
inlinevirtualinherited

The model function with parameters.

This method also evaluates the model; however, it sets the model at the input new point and then evaluates the model.

The size of the model vector can be obtained in advance by calling measurement_size().

Parameters
[in]xNew set of parameters
Returns
Evaluated model at the input new point

Definition at line 147 of file model_measure.h.

◆ param_a_posteriori_uncertainty()

Array< double, 1 > MaxAPosteriori::param_a_posteriori_uncertainty ( )
virtual

Returns the square root of the diagonal of the a-posteriori covariance matrix.

A-posteriori covariance matrix is returned by a_posteriori_covariance() method, and this method returns the square root of the diagonal of the matrix.

I am not sure where the best location for implementing this method is; however, it should be where a_posteriori_covariance() method is.

Returns
The square root of the diagonal of the a-posteriori covariance matrix

Definition at line 105 of file max_a_posteriori.cc.

◆ param_a_priori_uncertainty()

Array< double, 1 > MaxAPosteriori::param_a_priori_uncertainty ( ) const
virtual

Returns the square root of the diagonal of the a-priori covariance matrix.

A-priori covariance matrix is returned by a_priori_cov() method, and this method returns the square root of the diagonal of the matrix.

Returns
The square root of the diagonal of the a-priori covariance matrix

Definition at line 98 of file max_a_posteriori.cc.

◆ parameter_a_priori_diff()

virtual blitz::Array<double, 1> FullPhysics::MaxAPosteriori::parameter_a_priori_diff ( ) const
inlinevirtual

Returns the current parameters value and their a priori value difference (current param - a priori param)

This method is for convenience. It returns the difference of the current parameters value and their a priori value.

Let the following be the current parameters value (a vector) and the parameters a prior value (another vector) respectively

  • X
  • Xa

Then this method returns

\[ X - X_a \]

Returns
The current parameters values and their a-priori value difference (current param - a priori param)

Definition at line 94 of file max_a_posteriori.h.

◆ parameter_size()

virtual int FullPhysics::ProblemState::parameter_size ( ) const
inlinevirtualinherited

Returns the size of the parameters.

Returns
Size of parameters

Definition at line 163 of file problem_state.h.

◆ parameters() [1/2]

void ProblemState::parameters ( const blitz::Array< double, 1 > &  x)
virtualinherited

Sets the problem at a new point in the parameter space.

The method calls parameters_different() to determine whether or not the new parameters are different:

  • If different, then it deletes the object state (see clear()), and the input x becomes the current state.
  • If not different, then the input parameters are ignored.
Parameters
[in]xNew set of parameters

Reimplemented in FullPhysics::NLLSProblemScaled, FullPhysics::NLLSMaxAPosteriori, FullPhysics::NLLSMaxLikelihood, and FullPhysics::ModelMeasureStandard.

Definition at line 36 of file problem_state.cc.

◆ parameters() [2/2]

virtual blitz::Array<double, 1> FullPhysics::ProblemState::parameters ( ) const
inlinevirtualinherited

Returns the current parameters.

Returns
Current parameter

Reimplemented in FullPhysics::NLLSProblemScaled, FullPhysics::NLLSMaxAPosteriori, FullPhysics::NLLSMaxLikelihood, and FullPhysics::ModelMeasureStandard.

Definition at line 153 of file problem_state.h.

◆ parameters_different()

bool ProblemState::parameters_different ( const blitz::Array< double, 1 > &  x) const
virtualinherited

Checks whether or not new input parameters are different from the current ones.

The methods checks to see whether or not the new input parameters (point in the parameter space) are different from the parameters maintained by the object for which the method is called.

If the size of the input parameters is not equal to the expected size of the parameters (check comments on expected_parameter_size), then the method will throw an exception.

If the object for which the method is called has currently no parameters set, then the method returns true. Otherwise, the method uses some algorithm to figure out when the difference is "big enough" to be considered different. If the method determines that the new input parameters are different from the current parameters, then it returns true, otherwise, it returns false.

Parameters
[in]xNew set of parameters

Definition at line 9 of file problem_state.cc.

◆ print()

virtual void FullPhysics::MaxAPosteriori::print ( std::ostream &  Os) const
inlinevirtual

Prints description of object.

Reimplemented from FullPhysics::ModelMeasure.

Reimplemented in FullPhysics::MaxAPosterioriStandard.

Definition at line 62 of file max_a_posteriori.h.

◆ print_to_string()

std::string FullPhysics::Printable< ProblemState >::print_to_string ( ) const
inlineinherited

Print to string.

This is primarily useful for SWIG wrappers to this class, e.g. a to_s method in ruby.

Definition at line 31 of file printable.h.

◆ set() [1/2]

void ModelState::set ( const ModelState s)
virtualinherited

Makes self a copy of the input state.

This method makes the object, for which it is called, a copy of the input state.

Parameters
[in]sanother ModelState

Definition at line 7 of file model_state.cc.

◆ set() [2/2]

virtual void FullPhysics::ProblemState::set ( const ProblemState s)
inlinevirtualinherited

Makes self a copy of the input state.

This method makes the object, for which it is called, a copy of the input state.

Parameters
[in]sanother ProblemState

Definition at line 88 of file problem_state.h.

◆ set_measurement()

void ModelMeasure::set_measurement ( const blitz::Array< double, 1 > &  measurement,
const blitz::Array< double, 1 > &  measurement_error_cov 
)
inherited

For setting measurement and the error covariance matrix.

Parameters
[in]measurementThe measurement to which the model is to be fitted
[in]measurement_error_covThe measurement error covariance matrix assumed to be diagonal (hence simply a vector containing the diagonal)

Definition at line 9 of file model_measure.cc.

◆ uncert_weighted_jac_inner_product()

Array< double, 2 > ModelMeasure::uncert_weighted_jac_inner_product ( )
virtualinherited

Returns the inner product of the matrix returned by the method uncert_weighted_jacobian() by itself.

Let the following be the computed model Jacobian and the measurement error covariance matrix respectively:

  • K
  • Se

Then this method returns

\[ K^TS_e^{-1}K \]

Returns
The inner product of the matrix returned by the method uncert_weighted_jacobian() by itself.

Definition at line 54 of file model_measure.cc.

◆ uncert_weighted_jacobian()

Array< double, 2 > ModelMeasure::uncert_weighted_jacobian ( )
virtualinherited

Returns the model Jacobian weighted by the inverse of the Cholesky decomposition of the error covariance matrix.

This method is for convenience. It returns the model Jacobian weighted by the Cholesky decomposition (roughly speaking the square root) of the error covariance matrix.

Let the following be the computed model Jacobian and the measurement error covariance matrix respectively:

  • K
  • Se

Then the Cholesky decomposition of the error covariance matrix is

\[ S_e = C_e C_e^T \]

and this method returns

\[ C_e^{-1}K \]

The method uncert_weighted_model_measure_diff() is another function of the parameters, and the method uncert_weighted_jacobian() is the Jacobian of uncert_weighted_model_measure_diff().

Returns
Model Jacobian weighted by the inverse of the Cholesky decomposition of the error covariance matrix

Definition at line 45 of file model_measure.cc.

◆ uncert_weighted_model_measure_diff()

virtual blitz::Array<double, 1> FullPhysics::ModelMeasure::uncert_weighted_model_measure_diff ( )
inlinevirtualinherited

Returns model and measurement difference weighted by the inverse of the Cholesky decomposition of the error covariance matrix.

This method is for convenience. It returns the difference of the computed model and measurement, model_measure_diff(), weighted by the Cholesky decomposition (roughly speaking the square root) of the error covariance matrix. In the name of this method "uncert" is the short for uncertainty, but probably using the word uncertainty or uncert in the name of this method is a bad Idea. In the implementation of this class the error covariance matrix is implemented as a diagonal matrix. However, if the matrix were not diagonal, still the purpose of this method would be to weight the model and the measurement difference with the Cholesky decomposition of the entire error covariance matrix.

Let the following be the computed model, the measured data, and the measurement error covariance matrix respectively:

  • M
  • S
  • Se

Then the Cholesky decomposition of the error covariance matrix is

\[ S_e = C_e C_e^T \]

and this method returns

\[ C_e^{-1}(M-S) \]

Returns
Model and measurement difference weighted by the inverse of the Cholesky decomposition of the error covariance matrix

Definition at line 451 of file model_measure.h.

◆ weighted_jacobian_aug()

Array< double, 2 > MaxAPosteriori::weighted_jacobian_aug ( )
virtual

Returns the matrix returned by uncert_weighted_jacobian() augmented at the bottom by the matrix returned by a_priori_cov_chol_inv()

This method is for convenience. It returns an augmented matrix. The matrices returned by the following methods appear at the top and at the bottom of the augmented matrix respectively:

Assume the following:

  • K (computed model Jacobian)
  • Se (measurement error covariance matrix)
  • Sa (a priori covariance matrix)

The Cholesky decomposition of the error covariance matrix is

\[ S_e = C_e C_e^T \]

and the Cholesky decomposition of the a priori covariance matrix is

\[ S_a = C_a C_a^T \]

Then this method returns

\[ \left[ \begin{array}{c} C_e^{-1}K --- C_a^{-1} \end{array} \right] \]

The method weighted_model_measure_diff_aug() is another function of the parameters, and the method weighted_jacobian_aug() is the Jacobian of weighted_model_measure_diff_aug().

Returns
The matrix returned by uncert_weighted_jacobian() augmented at the bottom by the matrix returned by a_priori_cov_chol_inv()

Definition at line 65 of file max_a_posteriori.cc.

◆ weighted_model_measure_diff_aug()

Array< double, 1 > MaxAPosteriori::weighted_model_measure_diff_aug ( )
virtual

Returns the vector returned by uncert_weighted_model_measure_diff() augmented at the bottom by the vector returned by cov_weighted_parameter_a_priori_diff()

This method is for convenience. It returns an augmented vector. The vectors returned by the following methods appear at the top and at the bottom of the augmented vector respectively:

Assume the following:

  • M (computed model)
  • S (measurement data)
  • Se (measurement error covariance matrix)
  • X (current parameters value)
  • Xa (parameters a priori value)
  • Sa (a priori covariance matrix)

The Cholesky decomposition of the error covariance matrix is

\[ S_e = C_e C_e^T \]

and the Cholesky decomposition of the a priori covariance matrix is

\[ S_a = C_a C_a^T \]

Then this method returns

\[ \left[ \begin{array}{c} C_e^{-1}(M-S) ------ C_a^{-1}(X-X_a) \end{array} \right] \]

Returns
The vector returned by uncert_weighted_model_measure_diff() augmented at the bottom by the vector returned by cov_weighted_parameter_a_priori_diff()

Definition at line 54 of file max_a_posteriori.cc.

Member Data Documentation

◆ K

blitz::Array<double, 2> FullPhysics::ModelState::K
protectedinherited

Definition at line 99 of file model_state.h.

◆ M

blitz::Array<double, 1> FullPhysics::ModelState::M
protectedinherited

Definition at line 98 of file model_state.h.

◆ msrmnt

blitz::Array<double, 1> FullPhysics::ModelMeasure::msrmnt
protectedinherited

Definition at line 512 of file model_measure.h.

◆ Sa

blitz::Array<double, 2> FullPhysics::MaxAPosteriori::Sa
protected

Definition at line 447 of file max_a_posteriori.h.

◆ Sa_chol

blitz::Array<double, 2> FullPhysics::MaxAPosteriori::Sa_chol
protected

Definition at line 450 of file max_a_posteriori.h.

◆ Sa_chol_inv

blitz::Array<double, 2> FullPhysics::MaxAPosteriori::Sa_chol_inv
protected

Definition at line 451 of file max_a_posteriori.h.

◆ Se

blitz::Array<double, 1> FullPhysics::ModelMeasure::Se
protectedinherited

Definition at line 513 of file model_measure.h.

◆ Se_chol

blitz::Array<double, 1> FullPhysics::ModelMeasure::Se_chol
protectedinherited

Definition at line 516 of file model_measure.h.

◆ X

blitz::Array<double, 1> FullPhysics::ProblemState::X
protectedinherited

Definition at line 222 of file problem_state.h.

◆ Xa

blitz::Array<double, 1> FullPhysics::MaxAPosteriori::Xa
protected

Definition at line 446 of file max_a_posteriori.h.


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

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