KLdist function with unequal sample sizes
1
0
Entering edit mode
wrighth ▴ 260
@wrighth-3452
Last seen 10.2 years ago
I¹m attempting to use the Kldist function to calculate distances between a couple of data sets which unfortunately have unequal sample sizes. Essentially, I¹ve gotten the data sets into two matrices with one feature type per column, so m1[,1] is the same data type as m2[,1]. The documentation for the function indicates that I need to get the columns into rows and then coerce them into list form; I¹ve tried: l1 <- list(t(m1[,1], t(m2[1,])) KLdist.matrix(l1) Which gives me back: [,1] [,2] [1,] -1.979871e-15 2.529427e-01 [2,] 1.795909e-02 -1.503161e-15 Which seems wrong. Shouldn¹t I be getting back a single KL distance between the samples? Am I constructing the list object incorrectly? Hollis Wright, MS PhD Candidate, DMICE Oregon Health and Science University [[alternative HTML version deleted]]
• 546 views
ADD COMMENT
0
Entering edit mode
@wolfgang-huber-3550
Last seen 12 weeks ago
EMBL European Molecular Biology Laborat…
wrighth ha scritto: > I?m attempting to use the Kldist function to calculate distances between a > couple of data sets which unfortunately have unequal sample sizes. > Essentially, I?ve gotten the data sets into two matrices with one feature > type per column, so m1[,1] is the same data type as m2[,1]. The > documentation for the function indicates that I need to get the columns into > rows and then coerce them into list form; I?ve tried: > > l1 <- list(t(m1[,1], t(m2[1,])) > KLdist.matrix(l1) > > Which gives me back: > > [,1] [,2] > [1,] -1.979871e-15 2.529427e-01 > [2,] 1.795909e-02 -1.503161e-15 > > Which seems wrong. Shouldn?t I be getting back a single KL distance between > the samples? Am I constructing the list object incorrectly? > > Hollis Wright, MS > PhD Candidate, DMICE > Oregon Health and Science University > > [[alternative HTML version deleted]] > > > - Dear Hollis thank you for your feedback. I cannot comment on the substance of your query, but it is likely that you will get better answers by (i) providing the output of sessionInfo() (ii) providing a simple stand-alone code example that others can reproduce (without access to private objects in your workspace). You could consult the posting guide for more details. It also seems that the code example you give would never run, as it contains a Syntax error. Best wishes Wolfgang ------------------------------------------------ Wolfgang Huber, EMBL, http://www.ebi.ac.uk/huber
ADD COMMENT

Login before adding your answer.

Traffic: 571 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6