Comments (4)
Can you provide an example of the input and the current and desired output? Currently, the functions only allow to pass instances from two random vectors. I was trying to implement pairwise computation of these measures (look at the develop branch), but it is not publicly available right now, and I intended to use a separate function for that, because I think it is more clear that way.
from dcor.
Sure, I think the issue is that I don't follow what you mean by instances of random vectors
import numpy as np
import dcor
a = np.array([1, 2, 3, 4])
b = np.array([5,8,6,2])
c = np.column_stack(a,b) # i.e. a (4,2) matrix
so for dcor.distance_correlation(a,a)
we'd expect 1.0 and for dcor.distance_correlation(a,b)
I get 0.795. For `dcor.distance_correlation(a,c)' I'd expect back the vector [[1.0] [0.795]] but I instead get a single scalar 0.886
from dcor.
distance_correlation
interprets those as follows:
a
andb
both contain 4 evaluations of a random variable.c
contains 4 evaluations of a random vector, with 2 elements.
Thusdistance_correlation(a, c)
is well defined, as distance correlation is defined even for two random vectors with different dimensions, and the result is a single number.
from dcor.
ahh okay now I see, thanks! I hadn't really thought about the fact that we could have vectors with different dimensions due to the distance matrix being constructed from the norms and that's what was confusing me.
A pairwise implementation would be good but I can just refactor my code to use dcor.distance_covariance to stop the redundant calculation of dvar(Y) when iterating over arrays of random variables
from dcor.
Related Issues (20)
- Question: is there a fast method for `dcor.independence.distance_covariance_test` HOT 2
- OSError: [Errno 36] File name too long when importing dcor HOT 5
- Is there a fast way of doing pairwise distance correlation (dcor.distance_correlation) HOT 8
- __version__ returns 0.0. Version number is on a separate file HOT 6
- AttributeError: 'float' object has no attribute 'dtype' HOT 1
- Process killed due to very large array HOT 2
- FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\domin\\PycharmProjects\\Trading_Backtesting_ML\\venv\\lib\\site-packages\\dcor\\__pycache__\\_fast_dcov_mergesort._generate_distance_covariance_sqr_mergesort_generic_impl.locals._distance_covariance_sqr_mergesort_generic_impl-163.py38.nbi.tmp.4ae6be2f415b45ff' HOT 2
- Improve performance of pairwise distances computation
- Add goodness-of-fit tests
- Add distance skewness and symmetry test
- Implement distance components (DISCO)
- Study and implement energy-based clustering
- Implement energy distance in terms of distance covariance
- Adding support for python 3.7 HOT 1
- Question about the shape of the input array HOT 3
- Can dcor with method 'AVL' or 'megresort' is applicable between two data types float and integer, respectively or it always has to be float? HOT 13
- Can distance correlation-based t test is theoretically correct to implement for "uni"-dimensional data? HOT 2
- Seemingly incorrect results with `int` datatype HOT 3
- Incorrect documentation about arbitrary dimensions HOT 2
- Range of distance correlation HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dcor.