def compute_pvalue(self, samples):
samples = self._make_two_dimensional(samples)
self.shape = samples.shape[1]
stein_statistics = []
for f in range(self.number_of_random_frequencies):
# This is a little bit of a bug , but th holds even for this choice
random_frequency = np.random.randn()
matrix_of_stats = self.stein_stat(random_frequency=random_frequency, samples=samples)
stein_statistics.append(matrix_of_stats)
normal_under_null = np.hstack(stein_statistics)
normal_under_null = self._make_two_dimensional(normal_under_null)
return mahalanobis_distance(normal_under_null, normal_under_null.shape[1])
评论列表
文章目录