Changeset 899 for trunk/yat/statistics


Ignore:
Timestamp:
Sep 26, 2007, 11:26:25 PM (14 years ago)
Author:
Peter
Message:

changed euclidean to fulfill design criteria, removes sum_squared_deviation from AveragerPairWeighted?, also changed vector::sort to use stl rather than gsl. refs #248 and fixes #253

Location:
trunk/yat/statistics
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/statistics/AveragerPairWeighted.cc

    r890 r899  
    9696  double AveragerPairWeighted::msd(void) const
    9797  {
    98     return sum_squared_deviation()/w_;
     98    return (x_.sum_wxx()+y_.sum_wxx()-2*wxy_)/w_;
     99  }
     100
     101
     102  double AveragerPairWeighted::n(void) const
     103  {
     104    return x_.n();
    99105  }
    100106
     
    105111  }
    106112
    107   double AveragerPairWeighted::sum_squared_deviation(void) const
    108   {
    109     return x_.sum_wxx()+y_.sum_wxx()-2*wxy_;
    110   }
    111  
    112113
    113114  double AveragerPairWeighted::sum_w(void) const
  • trunk/yat/statistics/AveragerPairWeighted.h

    r892 r899  
    127127    double msd(void) const;
    128128
     129    /**
     130       @return \f$ \frac{\left(\sum w_x w_y\right)^2}{\sum w_x^2w_y^2} \f$
     131    */
     132    double n(void) const;
     133
    129134    ///
    130135    /// @brief Reset everything to zero
    131136    ///
    132137    void reset(void);
    133 
    134     /**
    135        @return Sum of weighted squared deviation between x and y \f$
    136        \sum w_xw_y (x-y)^2 \f$
    137 
    138        \note This function is not invariant under rescaling of weights.
    139     */
    140     double sum_squared_deviation(void) const;
    141138
    142139    ///
  • trunk/yat/statistics/euclidean_vector_distance.h

    r898 r899  
    5454    AveragerPairWeighted ap;
    5555    add(ap,beg1,end1,beg2);
    56     return sqrt(ap.sum_squared_deviation());
     56    return sqrt(ap.n()*ap.msd());
    5757  }
    5858
Note: See TracChangeset for help on using the changeset viewer.