Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
JACOUSTICS::JKatoomba< JAbstractMinimiser > Struct Template Reference

Template specialisation of fit function of acoustic model based on JAbstractMinimiser minimiser. More...

#include <JKatoomba.hh>

Inheritance diagram for JACOUSTICS::JKatoomba< JAbstractMinimiser >:
JFIT::JAbstractMinimiser< JModel_t > JACOUSTICS::JKatoomba_t JEEP::JMessage< T > JACOUSTICS::JGeometry

Public Types

typedef double result_type
 

Public Member Functions

 JKatoomba (const JDetector &detector, const JSoundVelocity &velocity)
 Constructor. More...
 
template<class JPDF_t >
result_type operator() (const JModel &model, const JHit< JPDF_t > &hit) const
 Fit function. More...
 
template<class T >
result_type operator() (const JModel &model, T __begin, T __end)
 Fit. More...
 
template<class JFunction_t , class T >
result_type operator() (const JFunction_t &fit, T __begin, T __end)
 Get chi2. More...
 
template<class JPDF_t >
double getToA (const JModel &model, const JHit< JPDF_t > &hit) const
 Get estimated time-of-arrival for given hit. More...
 

Public Attributes

JModel_t value
 model value More...
 
const JDetectordetector
 
const JSoundVelocityvelocity
 
JLANG::JSharedPointer
< JMEstimator
estimator
 M-Estimator function. More...
 

Static Public Attributes

static int debug = 0
 debug level (default is off). More...
 

Detailed Description

template<>
struct JACOUSTICS::JKatoomba< JAbstractMinimiser >

Template specialisation of fit function of acoustic model based on JAbstractMinimiser minimiser.


This class can be used to evaluate the chi2.

Definition at line 94 of file JKatoomba.hh.

Member Typedef Documentation

Definition at line 98 of file JKatoomba.hh.

Constructor & Destructor Documentation

JACOUSTICS::JKatoomba< JAbstractMinimiser >::JKatoomba ( const JDetector detector,
const JSoundVelocity velocity 
)
inline

Constructor.

Parameters
detectordetector
velocitysound velocity

Definition at line 107 of file JKatoomba.hh.

108  :
109  JKatoomba_t(detector, velocity)
110  {};
JKatoomba_t(const JDetector &detector, const JSoundVelocity &velocity)
Constructor.
Definition: JKatoomba.hh:47
const JDetector & detector
Definition: JKatoomba.hh:75

Member Function Documentation

template<class JPDF_t >
result_type JACOUSTICS::JKatoomba< JAbstractMinimiser >::operator() ( const JModel model,
const JHit< JPDF_t > &  hit 
) const
inline

Fit function.


This method is used to determine the chi2 of given hit with respect to actual model.

Parameters
modelmodel
hithit
Returns
chi2 and gradient

Definition at line 122 of file JKatoomba.hh.

123  {
124  const double toa_s = this->getToA(model, hit);
125  const double u = (toa_s - hit.getValue()) / hit.sigma;
126 
127  return estimator->getRho(u);
128  }
JLANG::JSharedPointer< JMEstimator > estimator
M-Estimator function.
Definition: JKatoomba.hh:78
double getToA(const JModel &model, const JHit< JPDF_t > &hit) const
Get estimated time-of-arrival for given hit.
Definition: JKatoomba.hh:62
double u[N+1]
Definition: JPolint.hh:706
template<class T >
result_type JACOUSTICS::JKatoomba< JAbstractMinimiser >::operator() ( const JModel model,
T  __begin,
T  __end 
)
inline

Fit.

Parameters
modelmodel
__beginbegin of hits
__endend of hits
Returns
chi2

Definition at line 140 of file JKatoomba.hh.

141  {
142  this->value = model;
143 
144  return JAbstractMinimiser<JModel>::operator()(*this, __begin, __end);
145  }
result_type operator()(const JFunction_t &fit, T __begin, T __end)
Get chi2.
Definition: JRegressor.hh:46
JModel_t value
model value
Definition: JRegressor.hh:57
template<class JModel_t>
template<class JFunction_t , class T >
result_type JFIT::JAbstractMinimiser< JModel_t >::operator() ( const JFunction_t &  fit,
T  __begin,
T  __end 
)
inlineinherited

Get chi2.

Parameters
fitfit function
__beginbegin of data
__endend of data
Returns
chi2

Definition at line 46 of file JRegressor.hh.

47  {
48  double chi2 = 0.0;
49 
50  for (T i = __begin; i != __end; ++i) {
51  chi2 += fit(value, *i);
52  }
53 
54  return chi2;
55  }
do set_variable OUTPUT_DIRECTORY $WORKDIR T
JModel_t value
model value
Definition: JRegressor.hh:57
template<class JPDF_t >
double JACOUSTICS::JKatoomba_t::getToA ( const JModel model,
const JHit< JPDF_t > &  hit 
) const
inlineinherited

Get estimated time-of-arrival for given hit.

Parameters
modelmodel
hithit
Returns
time-of-arrival

Definition at line 62 of file JKatoomba.hh.

63  {
64  const JString& string = detector[hit.getString()];
65  const JModel::JString& parameters = model.string[hit.getString()];
66  const JPosition3D position = string.getPosition(parameters, hit.getFloor());
67 
68  const double D = hit.getDistance(position);
69  const double Vi = velocity.getInverseVelocity(D, hit.getZ(), position.getZ());
70 
71  return model.emitter[hit.getEKey()].t1 + D * Vi;
72  }
do echo Generating $dir eval D
Definition: JDrawLED.sh:50
int getFloor() const
Get floor number.
Definition: JLocation.hh:145
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Definition: diff-Tuna.sh:38
JEKey getEKey() const
Get emitter hash key of this hot.
double getDistance(const JVector3D &pos) const
Get distance to point.
Definition: JVector3D.hh:269
JACOUSTICS::JModel::emitter_map emitter
JACOUSTICS::JModel::string_map string
virtual double getInverseVelocity(const double D_m, const double z1, const double z2) const
Get inverse velocity of sound.
int getString() const
Get string number.
Definition: JLocation.hh:134
const JDetector & detector
Definition: JKatoomba.hh:75
const JSoundVelocity & velocity
Definition: JKatoomba.hh:76
double getZ() const
Get z position.
Definition: JVector3D.hh:114

Member Data Documentation

template<class JModel_t>
JModel_t JFIT::JAbstractMinimiser< JModel_t >::value
inherited

model value

Definition at line 57 of file JRegressor.hh.

template<class T>
int JEEP::JMessage< T >::debug = 0
staticinherited

debug level (default is off).

Definition at line 45 of file JMessage.hh.

const JDetector& JACOUSTICS::JKatoomba_t::detector
inherited

Definition at line 75 of file JKatoomba.hh.

const JSoundVelocity& JACOUSTICS::JKatoomba_t::velocity
inherited

Definition at line 76 of file JKatoomba.hh.

JLANG::JSharedPointer<JMEstimator> JACOUSTICS::JKatoomba_t::estimator
inherited

M-Estimator function.

Definition at line 78 of file JKatoomba.hh.


The documentation for this struct was generated from the following file: