Skip to content
This repository was archived by the owner on Oct 29, 2020. It is now read-only.
This repository was archived by the owner on Oct 29, 2020. It is now read-only.

type error when using MGC.p_value() on longs #153

@tathey1

Description

@tathey1

Describe the bug
data type error when using MGC.p_value() on long type

To Reproduce
from mgcpy.independence_tests.mgc import MGC
a = np.array([[1.,1.],[1.,1.]])
b = np.array([[2.,2.],[2.,2.]])
mgc.p_value(a,b)
Expected behavior
I expected this to work.

Error output

ValueError Traceback (most recent call last)
in
8 a = np.array([[1.,1.],[1.,1.]])
9 b = np.array([[2.,2.],[2.,2.]])
---> 10 mgc.p_value(a,b)
11
12 indices_1 = np.cumsum(n1)

~\Anaconda3\lib\site-packages\mgcpy-0.3.0-py3.7-win-amd64.egg\mgcpy\independence_tests\mgc.py in p_value(self, matrix_X, matrix_Y, replication_factor, is_fast, fast_mgc_data)
226 return p_value, p_value_metadata
227 else:
--> 228 return super(MGC, self).p_value(matrix_X, matrix_Y)
229
230 def _fast_mgc_p_value(self, matrix_X, matrix_Y, sub_samples=10):

~\Anaconda3\lib\site-packages\mgcpy-0.3.0-py3.7-win-amd64.egg\mgcpy\independence_tests\abstract_class.py in p_value(self, matrix_X, matrix_Y, replication_factor)
89
90 # calculte the test statistic with the given data
---> 91 test_statistic, independence_test_metadata = self.test_statistic(matrix_X, matrix_Y)
92
93 if self.get_name() == "unbiased":

~\Anaconda3\lib\site-packages\mgcpy-0.3.0-py3.7-win-amd64.egg\mgcpy\independence_tests\mgc.py in test_statistic(self, matrix_X, matrix_Y, is_fast, fast_mgc_data)
88 distance_matrix_X, distance_matrix_Y = compute_distance(matrix_X, matrix_Y, self.compute_distance_matrix)
89 local_correlation_matrix = local_correlations(distance_matrix_X, distance_matrix_Y,
---> 90 base_global_correlation=self.base_global_correlation)["local_correlation_matrix"]
91 m, n = local_correlation_matrix.shape
92 if m == 1 or n == 1:

mgcpy\independence_tests\mgc_utils\local_correlation.pyx in mgcpy.independence_tests.mgc_utils.local_correlation.local_correlations()

mgcpy\independence_tests\mgc_utils\local_correlation.pyx in mgcpy.independence_tests.mgc_utils.local_correlation.local_correlations()

mgcpy\independence_tests\mgc_utils\local_correlation.pyx in mgcpy.independence_tests.mgc_utils.local_correlation.local_covariance()

ValueError: Buffer dtype mismatch, expected 'int_t' but got 'long long'

Desktop (please complete the following information):
-Recently downloaded off pip, using Windows 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions