Diploma Thesis Percolation Simulation
C++ Sourcecode Documentation

www.AndreasKrueger.de/thesis/code

Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

statistics::statistical< RES, ELEM > Class Template Reference

#include <statistics.h>

List of all members.

Public Methods

RES lineardis (ELEM x, RES mu)
RES squaredis (ELEM x, RES mu)
RES cubicdis (ELEM x, RES mu)
RES pow4dis (ELEM x, RES mu)
RES average_of_list (RES(statistical< RES, ELEM >::*outer_fn)(ELEM, RES), RES mu, ELEM(manipdata< ELEM >::*inner_fn)(ELEM, ELEM), ELEM fn_arg, std::list< ELEM > &L)
RES standarddeviation_of_list (RES av, RES(statistical< RES, ELEM >::*outer_fn)(ELEM, RES), RES mu, ELEM(manipdata< ELEM >::*inner_fn)(ELEM, ELEM), ELEM fn_arg, std::list< ELEM > &L)
measure< RES > general_moment (RES(statistical< RES, ELEM >::*distfn)(ELEM, RES), RES mu, ELEM(manipdata< ELEM >::*inner_fn)(ELEM, ELEM), ELEM fn_arg, std::list< ELEM > &elements)
measure< RES > average (ELEM(manipdata< ELEM >::*inner_fn)(ELEM, ELEM), ELEM fn_arg, std::list< ELEM > &elements)
measure< RES > variance (ELEM(manipdata< ELEM >::*inner_fn)(ELEM, ELEM), ELEM fn_arg, std::list< ELEM > &elements, RES mu)
measure< RES > s3 (ELEM(manipdata< ELEM >::*inner_fn)(ELEM, ELEM), ELEM fn_arg, std::list< ELEM > &elements, RES mu)
measure< RES > s4 (ELEM(manipdata< ELEM >::*inner_fn)(ELEM, ELEM), ELEM fn_arg, std::list< ELEM > &elements, RES mu)
measure< RES > skewness (ELEM(manipdata< ELEM >::*inner_fn)(ELEM, ELEM), ELEM fn_arg, std::list< ELEM > &elements, RES mu, RES sigma)
measure< RES > kurtosis (ELEM(manipdata< ELEM >::*inner_fn)(ELEM, ELEM), ELEM fn_arg, std::list< ELEM > &elements, RES mu, RES sigma)

template<class RES, class ELEM>
class statistics::statistical< RES, ELEM >


Member Function Documentation

template<class RES, class ELEM>
measure< RES > statistics::statistical< RES, ELEM >::average ELEM(manipdata< ELEM >::*    inner_fn)(ELEM, ELEM),
ELEM    fn_arg,
std::list< ELEM > &    elements
 

Definition at line 173 of file statistics.h.

References statistics::statistical< RES, ELEM >::general_moment().

Referenced by statistics::calculate_all_moments(), and statistics::calculate_moments().

00174                                                                                     {
00175         RES (statistical<RES,ELEM>::*distfn)(ELEM,RES)= &statistical<RES,ELEM>::lineardis;
00176         return general_moment(distfn, 0, inner_fn, fn_arg, elements);
00177 }

template<class RES, class ELEM>
RES statistics::statistical< RES, ELEM >::average_of_list RES(statistical< RES, ELEM >::*    outer_fn)(ELEM, RES),
RES    mu,
ELEM(manipdata< ELEM >::*    inner_fn)(ELEM, ELEM),
ELEM    fn_arg,
std::list< ELEM > &    L
 

Definition at line 118 of file statistics.h.

Referenced by statistics::statistical< RES, ELEM >::general_moment().

00120                                                          {
00121         manipdata<ELEM>      *processdata=NULL;
00122         statistical<RES,ELEM> *distfn=NULL;
00123         std::list<ELEM>::iterator one;
00124 
00125         RES sum=(RES)0;
00126         for (one=L.begin();one!=L.end();one++){
00127                 sum += (distfn->*outer_fn)((processdata->*inner_fn)(*one, fn_arg), mu);
00128         }
00129         return sum/(RES)L.size();
00130 }

template<class RES, class ELEM>
RES statistics::statistical< RES, ELEM >::cubicdis ELEM    x,
RES    mu
[inline]
 

Definition at line 65 of file statistics.h.

References pow().

00065 {return pow((RES)x-mu,3);};

template<class RES, class ELEM>
measure< RES > statistics::statistical< RES, ELEM >::general_moment RES(statistical< RES, ELEM >::*    distfn)(ELEM, RES),
RES    mu,
ELEM(manipdata< ELEM >::*    inner_fn)(ELEM, ELEM),
ELEM    fn_arg,
std::list< ELEM > &    elements
 

Definition at line 159 of file statistics.h.

References measure< T >::av(), statistics::statistical< RES, ELEM >::average_of_list(), measure< T >::set_av(), measure< T >::set_sdev(), and statistics::statistical< RES, ELEM >::standarddeviation_of_list().

Referenced by statistics::statistical< RES, ELEM >::average(), statistics::statistical< RES, ELEM >::s3(), statistics::statistical< RES, ELEM >::s4(), and statistics::statistical< RES, ELEM >::variance().

00163 {
00164         statistical<RES,ELEM> *s=NULL;
00165         measure<RES> temp;
00166         temp.set_av  (s->average_of_list(distfn, mu, inner_fn, fn_arg, elements));
00167         temp.set_sdev(s->standarddeviation_of_list(temp.av(), distfn, mu, inner_fn, fn_arg, elements) );
00168         return temp;
00169 }

template<class RES, class ELEM>
measure< RES > statistics::statistical< RES, ELEM >::kurtosis ELEM(manipdata< ELEM >::*    inner_fn)(ELEM, ELEM),
ELEM    fn_arg,
std::list< ELEM > &    elements,
RES    mu,
RES    sigma
 

Definition at line 212 of file statistics.h.

References pow(), and statistics::statistical< RES, ELEM >::s4().

Referenced by statistics::calculate_all_moments(), and statistics::calculate_moments().

00214                                                                                                     { // changed in v2.3: sigma not measure<RES> anymore
00215         if (sigma==0) return 0;
00216         return s4(inner_fn, fn_arg, elements, mu)/pow(sigma,4);
00217 }

template<class RES, class ELEM>
RES statistics::statistical< RES, ELEM >::lineardis ELEM    x,
RES    mu
[inline]
 

Definition at line 63 of file statistics.h.

00063 {return (RES)x-mu;};

template<class RES, class ELEM>
RES statistics::statistical< RES, ELEM >::pow4dis ELEM    x,
RES    mu
[inline]
 

Definition at line 66 of file statistics.h.

References pow().

00066 {return pow((RES)x-mu,4);};

template<class RES, class ELEM>
measure< RES > statistics::statistical< RES, ELEM >::s3 ELEM(manipdata< ELEM >::*    inner_fn)(ELEM, ELEM),
ELEM    fn_arg,
std::list< ELEM > &    elements,
RES    mu
 

Definition at line 189 of file statistics.h.

References statistics::statistical< RES, ELEM >::general_moment().

Referenced by statistics::statistical< RES, ELEM >::skewness().

00190                                                                                                                  {
00191         RES (statistical<RES,ELEM>::*distfn)(ELEM,RES)= &statistical<RES,ELEM>::cubicdis;
00192         return general_moment(distfn, mu, inner_fn, fn_arg, elements);
00193 }

template<class RES, class ELEM>
measure< RES > statistics::statistical< RES, ELEM >::s4 ELEM(manipdata< ELEM >::*    inner_fn)(ELEM, ELEM),
ELEM    fn_arg,
std::list< ELEM > &    elements,
RES    mu
 

Definition at line 196 of file statistics.h.

References statistics::statistical< RES, ELEM >::general_moment().

Referenced by statistics::statistical< RES, ELEM >::kurtosis().

00197                                                                                                                  {
00198         RES (statistical<RES,ELEM>::*distfn)(ELEM,RES)= &statistical<RES,ELEM>::pow4dis;
00199         return general_moment(distfn, mu, inner_fn, fn_arg, elements);
00200 }

template<class RES, class ELEM>
measure< RES > statistics::statistical< RES, ELEM >::skewness ELEM(manipdata< ELEM >::*    inner_fn)(ELEM, ELEM),
ELEM    fn_arg,
std::list< ELEM > &    elements,
RES    mu,
RES    sigma
 

Definition at line 204 of file statistics.h.

References pow(), and statistics::statistical< RES, ELEM >::s3().

Referenced by statistics::calculate_all_moments(), and statistics::calculate_moments().

00206                                                                                                     { // changed in v2.3: sigma not measure<RES> anymore
00207         if (sigma==0) return 0;
00208         else return s3(inner_fn, fn_arg, elements, mu)/pow(sigma,3);    
00209 }

template<class RES, class ELEM>
RES statistics::statistical< RES, ELEM >::squaredis ELEM    x,
RES    mu
[inline]
 

Definition at line 64 of file statistics.h.

References pow().

00064 {return pow((RES)x-mu,2);};

template<class RES, class ELEM>
RES statistics::statistical< RES, ELEM >::standarddeviation_of_list RES    av,
RES(statistical< RES, ELEM >::*    outer_fn)(ELEM, RES),
RES    mu,
ELEM(manipdata< ELEM >::*    inner_fn)(ELEM, ELEM),
ELEM    fn_arg,
std::list< ELEM > &    L
 

Definition at line 133 of file statistics.h.

References sqrt().

Referenced by statistics::statistical< RES, ELEM >::general_moment().

00136                                                                            {
00137         manipdata<ELEM>      *processdata=NULL;
00138         statistical<RES,ELEM> *distfn=NULL;
00139         std::list<ELEM>::iterator one;
00140 
00141         RES sdev=(RES)0;
00142         RES diff;
00143         for (one=L.begin();one!=L.end();one++){
00144                 diff=(distfn->*outer_fn)((processdata->*inner_fn)(*one, fn_arg), mu) - av ;  
00145                 sdev +=diff*diff;
00146         }
00147         if (L.size()<2) return sqrt(sdev);              // changed in version2.2:  
00148         return sqrt(sdev/(RES)(L.size()-1));    //  1/N  ->  1/(N-1)
00149 }

template<class RES, class ELEM>
measure< RES > statistics::statistical< RES, ELEM >::variance ELEM(manipdata< ELEM >::*    inner_fn)(ELEM, ELEM),
ELEM    fn_arg,
std::list< ELEM > &    elements,
RES    mu
 

Definition at line 180 of file statistics.h.

References statistics::statistical< RES, ELEM >::general_moment().

Referenced by statistics::calculate_all_moments(), and statistics::calculate_moments().

00181                                                                                                                            {
00182         RES (statistical<RES,ELEM>::*distfn)(ELEM,RES)= &statistical<RES,ELEM>::squaredis;
00183         return general_moment(distfn, mu, inner_fn, fn_arg, elements);
00184 }


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




Diploma Thesis Sourcecode Documentation
check out the text and the executable binaries

www.AndreasKrueger.de/thesis/code