Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #579 from karlnapf/master
quickfix
  • Loading branch information
karlnapf committed Jun 11, 2012
2 parents 51c3b36 + 0e9be8c commit 1532e15
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/shogun/statistics/QuadraticTimeMMD.cpp
Expand Up @@ -100,6 +100,7 @@ float64_t CQuadraticTimeMMD::compute_p_value(float64_t statistic)

switch (m_p_value_method)
{
#ifdef HAVE_LAPACK
case MMD2_SPECTRUM:
{
/* get samples from null-distribution and compute p-value of statistic */
Expand All @@ -110,6 +111,7 @@ float64_t CQuadraticTimeMMD::compute_p_value(float64_t statistic)
result=1.0-pos/null_samples.vlen;
break;
}
#endif // HAVE_LAPACK
case MMD2_GAMMA:
result=compute_p_value_gamma(statistic);
break;
Expand All @@ -121,6 +123,7 @@ float64_t CQuadraticTimeMMD::compute_p_value(float64_t statistic)
return result;
}

#ifdef HAVE_LAPACK
SGVector<float64_t> CQuadraticTimeMMD::sample_null_spectrum(index_t num_samples,
index_t num_eigenvalues)
{
Expand Down Expand Up @@ -182,6 +185,7 @@ SGVector<float64_t> CQuadraticTimeMMD::sample_null_spectrum(index_t num_samples,

return null_samples;
}
#endif // HAVE_LAPACK

float64_t CQuadraticTimeMMD::compute_p_value_gamma(float64_t statistic)
{
Expand Down
2 changes: 2 additions & 0 deletions src/shogun/statistics/QuadraticTimeMMD.h
Expand Up @@ -34,6 +34,7 @@ class CQuadraticTimeMMD : public CKernelTwoSampleTestStatistic
return "QuadraticTimeMMD";
};

#ifdef HAVE_LAPACK
/* returns a set of samples of an estimate of the null distribution
* using the Eigen-spectrum of the centered kernel matrix of the merged
* samples of p and q. May be used to compute p_value (easy)
Expand All @@ -52,6 +53,7 @@ class CQuadraticTimeMMD : public CKernelTwoSampleTestStatistic
*/
SGVector<float64_t> sample_null_spectrum(index_t num_samples,
index_t num_eigenvalues);
#endif // HAVE_LAPACK

/** Approximates the null-distribution by the two parameter gamma
* distribution. It works in O(m^2) where m is the number of samples
Expand Down

0 comments on commit 1532e15

Please sign in to comment.