# Changeset 149

Ignore:
Timestamp:
Sep 9, 2004, 3:35:13 PM (19 years ago)
Message:

modified score function

Location:
trunk/src
Files:
2 edited

### Legend:

Unmodified
 r141 //#include //Peter, should add a function to get the sign of the correlation namespace theplu { namespace cpptools { /// /// \f$\frac{\sum_i(x_i-\bar{x})(y_i-\bar{y})}{\sqrt{\sum_i /// \f$ \frac{\vert \sum_i(x_i-\bar{x})(y_i-\bar{y})\vert }{\sqrt{\sum_i /// (x_i-\bar{x})^2\sum_i (x_i-\bar{x})^2}}\f$. /// @return Pearson correlation. /// @return absolute value of Pearson correlation. /// double score(const gslapi::vector&, const gslapi::vector&, /// /// \f$ \frac{\sum_iw_i(x_i-\bar{x})(y_i-\bar{y})} /// \f$\frac{\vert \sum_iw_i(x_i-\bar{x})(y_i-\bar{y})\vert } /// {\sqrt{\sum_iw_i(x_i-\bar{x})^2\sum_iw_i(x_i-\bar{x})^2}}\f$, /// where \f$m_x = \frac{\sum w_ix_i}{\sum w_i}\f$ and \f$m_x = /// \frac{\sum w_ix_i}{\sum w_i}\f$. This expression is chosen to /// get a correlation equal to unity when \a x and \a y are /// equal. @return Weighted version of Pearson correlation. /// equal. @return absolute value of weighted version of Pearson /// correlation. /// double score(const gslapi::vector& x, const gslapi::vector& y, /// /// \f$\frac{\sum_iw^x_iw^y_i(x_i-m_x)(y_i-m_y)} /// \f$ \frac{\vert \sum_iw^x_iw^y_i(x_i-m_x)(y_i-m_y)\vert } /// {\sqrt{\sum_iw^x_iw^y_i(x_i-m_x)^2 /// /// \sum_iw^x_iw^y_i(y_i-m_y)^2}}\f$, where \f$m_x = \frac{\sum /// w_ix_i}{\sum w_i}\f\$. This expression is chosen to get a /// correlation equal to unity when \a x and \a y are /// equal. @return Weighted version of Pearson correlation. /// equal. @return absolute value of weighted version of Pearson /// correlation. /// double score(const gslapi::vector& x, const gslapi::vector& y, /// correlation is zero (and the data is Gaussian). Note that this /// function can only be used together with the unweighted /// score. @return one-sided p-value /// score. @return two-sided p-value /// double p_value();