ReFRACtor
FullPhysics::FitStatistic Class Reference

This class holds various parameters describing how good of a fit we have. More...

#include <convergence_check.h>

+ Inheritance diagram for FullPhysics::FitStatistic:
+ Collaboration diagram for FullPhysics::FitStatistic:

Public Types

enum  OUTCOME {
  NOT_SET = 0, CONVERGE_ALL_BAND_OK = 1, CONVERGE_NOT_ALL_BAND_OK = 2, EXCEED_MAX_ITERATION = 3,
  EXCEED_MAX_DIVERGENT = 4
}
 

Public Member Functions

 FitStatistic ()
 Default constructor. More...
 
 FitStatistic (bool Fit_succeeded, OUTCOME Outcome, int Number_iteration, int Number_divergent, double D_sigma_sq, double D_sigma_sq_scaled, double Chisq_apriori, double Chisq_measured, double Chisq_apriori_fc, double Chisq_measured_fc)
 
double chisq_measure_norm (const blitz::Array< double, 1 > &Residual, const blitz::Array< double, 1 > &Residual_cov_diag) const
 Calculate chisq for given residual and covariance matrix. More...
 
void from_stream (std::istream &is)
 Load data from a stream. More...
 
double gamma2 () const
 Parameter "gamma2", which is just chi2_apriori + chi2_measured. More...
 
double gamma2_fc () const
 Parameter "gamma2_fc", which is just chisq_apriori_fc + chisq_measured_fc. More...
 
void print (std::ostream &Os) const
 Print to a stream. More...
 
std::string print_to_string () const
 Print to string. More...
 
double residual_abs_rms (const blitz::Array< double, 1 > &Residual) const
 Calculate absolute root mean squared for given residual. More...
 
double residual_rel_rms (const blitz::Array< double, 1 > &Residual, const blitz::Array< double, 1 > &Rad_measure) const
 Calculate relative root mean squared for given residual. More...
 
void to_stream (std::ostream &os) const
 Dump data to a stream. More...
 

Public Attributes

double chisq_apriori
 Chisq of the X_i vs. the apriori X value. More...
 
double chisq_apriori_fc
 Chisq of the X_i vs. More...
 
double chisq_measured
 Chisq of the residuals of the measurement vs. model prediction. More...
 
double chisq_measured_fc
 Chisq of the residuals of the measurement vs. More...
 
double d_sigma_sq
 This is d_sigma_sq, which is the product of the correction to the state vector and the right hand size of the equation fit. More...
 
double d_sigma_sq_scaled
 This is d_sigma_sq, scaled by the size of the state vector. More...
 
bool fit_succeeded
 Was the fit successful? More...
 
int number_divergent
 Number of divergent steps. More...
 
int number_iteration
 Number of iterations. More...
 
OUTCOME outcome
 Flag indicating success of fit, or why fit wasn't succesful. More...
 

Detailed Description

This class holds various parameters describing how good of a fit we have.

This is pretty much just a structure to collect various statistics in one place.

Definition at line 12 of file convergence_check.h.

Member Enumeration Documentation

◆ OUTCOME

Enumerator
NOT_SET 
CONVERGE_ALL_BAND_OK 
CONVERGE_NOT_ALL_BAND_OK 
EXCEED_MAX_ITERATION 
EXCEED_MAX_DIVERGENT 

Definition at line 14 of file convergence_check.h.

Constructor & Destructor Documentation

◆ FitStatistic() [1/2]

FullPhysics::FitStatistic::FitStatistic ( )
inline

Default constructor.

Definition at line 21 of file convergence_check.h.

◆ FitStatistic() [2/2]

FullPhysics::FitStatistic::FitStatistic ( bool  Fit_succeeded,
OUTCOME  Outcome,
int  Number_iteration,
int  Number_divergent,
double  D_sigma_sq,
double  D_sigma_sq_scaled,
double  Chisq_apriori,
double  Chisq_measured,
double  Chisq_apriori_fc,
double  Chisq_measured_fc 
)
inline

Definition at line 28 of file convergence_check.h.

Member Function Documentation

◆ chisq_measure_norm()

double FullPhysics::FitStatistic::chisq_measure_norm ( const blitz::Array< double, 1 > &  Residual,
const blitz::Array< double, 1 > &  Residual_cov_diag 
) const
inline

Calculate chisq for given residual and covariance matrix.

Definition at line 150 of file convergence_check.h.

◆ from_stream()

void FullPhysics::FitStatistic::from_stream ( std::istream &  is)
inline

Load data from a stream.

Definition at line 59 of file convergence_check.h.

◆ gamma2()

double FullPhysics::FitStatistic::gamma2 ( ) const
inline

Parameter "gamma2", which is just chi2_apriori + chi2_measured.

Definition at line 111 of file convergence_check.h.

◆ gamma2_fc()

double FullPhysics::FitStatistic::gamma2_fc ( ) const
inline

Parameter "gamma2_fc", which is just chisq_apriori_fc + chisq_measured_fc.

Definition at line 117 of file convergence_check.h.

◆ print()

void FitStatistic::print ( std::ostream &  Os) const

Print to a stream.

Definition at line 15 of file convergence_check.cc.

◆ print_to_string()

std::string FullPhysics::Printable< FitStatistic >::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.

◆ residual_abs_rms()

double FullPhysics::FitStatistic::residual_abs_rms ( const blitz::Array< double, 1 > &  Residual) const
inline

Calculate absolute root mean squared for given residual.

Definition at line 158 of file convergence_check.h.

◆ residual_rel_rms()

double FullPhysics::FitStatistic::residual_rel_rms ( const blitz::Array< double, 1 > &  Residual,
const blitz::Array< double, 1 > &  Rad_measure 
) const
inline

Calculate relative root mean squared for given residual.

Definition at line 165 of file convergence_check.h.

◆ to_stream()

void FullPhysics::FitStatistic::to_stream ( std::ostream &  os) const
inline

Dump data to a stream.

Definition at line 45 of file convergence_check.h.

Member Data Documentation

◆ chisq_apriori

double FullPhysics::FitStatistic::chisq_apriori

Chisq of the X_i vs. the apriori X value.

Definition at line 123 of file convergence_check.h.

◆ chisq_apriori_fc

double FullPhysics::FitStatistic::chisq_apriori_fc

Chisq of the X_i vs.

the apriori X value forcasted using a linear approximation to the cost function.

Definition at line 136 of file convergence_check.h.

◆ chisq_measured

double FullPhysics::FitStatistic::chisq_measured

Chisq of the residuals of the measurement vs. model prediction.

Definition at line 129 of file convergence_check.h.

◆ chisq_measured_fc

double FullPhysics::FitStatistic::chisq_measured_fc

Chisq of the residuals of the measurement vs.

model prediction forcasted using a linear approximation to the cost function.

Definition at line 143 of file convergence_check.h.

◆ d_sigma_sq

double FullPhysics::FitStatistic::d_sigma_sq

This is d_sigma_sq, which is the product of the correction to the state vector and the right hand size of the equation fit.

Definition at line 99 of file convergence_check.h.

◆ d_sigma_sq_scaled

double FullPhysics::FitStatistic::d_sigma_sq_scaled

This is d_sigma_sq, scaled by the size of the state vector.

Definition at line 105 of file convergence_check.h.

◆ fit_succeeded

bool FullPhysics::FitStatistic::fit_succeeded

Was the fit successful?

Definition at line 74 of file convergence_check.h.

◆ number_divergent

int FullPhysics::FitStatistic::number_divergent

Number of divergent steps.

Definition at line 92 of file convergence_check.h.

◆ number_iteration

int FullPhysics::FitStatistic::number_iteration

Number of iterations.

Definition at line 86 of file convergence_check.h.

◆ outcome

OUTCOME FullPhysics::FitStatistic::outcome

Flag indicating success of fit, or why fit wasn't succesful.

Definition at line 80 of file convergence_check.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:12