openModeller  Version 1.4.0
EnvironmentalDistance Class Reference

#include <environmental_distance.hh>

Inheritance diagram for EnvironmentalDistance:
Collaboration diagram for EnvironmentalDistance:

List of all members.

Public Member Functions

 EnvironmentalDistance ()
 ~EnvironmentalDistance ()
int initialize ()
int done () const
Scalar getValue (const Sample &x) const

Protected Member Functions

virtual void _getConfiguration (ConfigurationPtr &) const
virtual void _setConfiguration (const ConstConfigurationPtr &)

Private Types

enum  DistanceType { EuclideanDistance = FIRST_DISTANCE_TYPE, MahalanobisDistance, ManhattanDistance, ChebyshevDistance }

Private Member Functions

void _calc_covariance_matrix ()
Scalar _distance (const Sample &x, const Sample &y) const
bool _init_distance_type ()
Scalar _poz (Scalar z) const
Scalar _pochisq (Scalar x, int df) const

Private Attributes

bool _done
int _layer_count
int _presence_count
std::vector< Sample_presence_points
Scalar _par_dist
int _par_dist_type
int _par_point_qnt
bool _use_chisq
Matrix_cov_matrix
Matrix_cov_matrix_inv
Sample _average_point

Detailed Description

Definition at line 38 of file environmental_distance.hh.


Member Enumeration Documentation

Enumerator:
EuclideanDistance 
MahalanobisDistance 
ManhattanDistance 
ChebyshevDistance 

Definition at line 71 of file environmental_distance.hh.


Constructor & Destructor Documentation


Member Function Documentation

Scalar EnvironmentalDistance::_distance ( const Sample x,
const Sample y 
) const [inline, private]

Definition at line 352 of file environmental_distance.cpp.

References _layer_count, _par_dist_type, _use_chisq, ChebyshevDistance, EuclideanDistance, MahalanobisDistance, ManhattanDistance, and Sample::norm().

Referenced by _init_distance_type(), and getValue().

Here is the call graph for this function:

void EnvironmentalDistance::_getConfiguration ( ConfigurationPtr config) const [protected, virtual]

Reimplemented from AlgorithmImpl.

Definition at line 559 of file environmental_distance.cpp.

References _average_point, _done, _par_dist, and _presence_points.

Scalar EnvironmentalDistance::_pochisq ( Scalar  x,
int  df 
) const [private]

Compute probability of chi square value for the result not being due to chance. Code based on a C implementation in the public domain written by Gary Perlman from the Wang Institute, Tyngsboro, MA: http://www.stat.uchicago.edu/~mcpeek/software/CCQLSpackage1.3/chisq.c Original notes: Adapted from: Hill, I. D. and Pike, M. C. Algorithm 299 Collected Algorithms for the CACM 1967 p. 243 Updated for rounding errors based on remark in ACM TOMS June 1985, page 185

Parameters:
xobtained chi-square value
dfdegrees of freedom (number of environmental variables - 1)
Returns:
probability of chi square value.

Definition at line 519 of file environmental_distance.cpp.

References _poz(), BIGX, ex, I_SQRT_PI, and LOG_SQRT_PI.

Referenced by getValue().

Here is the call graph for this function:

Scalar EnvironmentalDistance::_poz ( Scalar  z) const [private]

Compute probability of probability of normal z value. Code based on a C implementation in the public domain written by Gary Perlman from the Wang Institute, Tyngsboro, MA: http://www.stat.uchicago.edu/~mcpeek/software/CCQLSpackage1.3/z.c Original notes: Adapted from a polynomial approximation in: Ibbetson D, Algorithm 209 Collected Algorithms of the CACM 1963 p. 616 This routine has six digit accuracy, so it is only useful for absolute z values < 6. For z values >= to 6.0, poz() returns 0.0

Parameters:
znormal z value
Returns:
cumulative probability from -oo to z

Definition at line 488 of file environmental_distance.cpp.

References Z_MAX.

Referenced by _pochisq().

int EnvironmentalDistance::done ( ) const [inline, virtual]

Return != 0 if algorithm finished.

Reimplemented from AlgorithmImpl.

Definition at line 45 of file environmental_distance.hh.

Scalar EnvironmentalDistance::getValue ( const Sample x) const [virtual]

The algorithm must return the occurrence probability at the given environment conditions.

Parameters:
xEnvironmental conditions.
Returns:
The occurrence probability in the range [0,1].

Implements AlgorithmImpl.

Definition at line 224 of file environmental_distance.cpp.

References _average_point, _distance(), _layer_count, _par_dist, _par_point_qnt, _pochisq(), _presence_count, _presence_points, and _use_chisq.

Here is the call graph for this function:


Member Data Documentation

Definition at line 50 of file environmental_distance.hh.

Referenced by _getConfiguration(), _setConfiguration(), and initialize().

Definition at line 58 of file environmental_distance.hh.

Referenced by _setConfiguration(), getValue(), and initialize().


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