Giter Site home page Giter Site logo

Comments (4)

vnmabus avatar vnmabus commented on September 25, 2024

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.

CompRhys avatar CompRhys commented on September 25, 2024

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.

vnmabus avatar vnmabus commented on September 25, 2024

distance_correlation interprets those as follows:

  • a and b both contain 4 evaluations of a random variable.
  • c contains 4 evaluations of a random vector, with 2 elements.
    Thus distance_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.

CompRhys avatar CompRhys commented on September 25, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.