令人费解的相关测量平均值

时间:2015-04-24 14:19:19

标签: r average correlation phylogeny

我将此问题提交给stat.stackexchange

https://stats.stackexchange.com/questions/147909/puzzling-average-of-correlated-measurements

但它似乎更适合该论坛,因为它可能更像是计算问题而不是统计数据:

我想平均相关测量。给定一组测量值:

x = ( x1, x2, x3 )

其内部相关性由协方差矩阵C给出。

Chi2最小化导致以下平均值:

<x> = C^-1 * x / C^-1

但下面的例子让我困惑:

让我们考虑以下树:

tree.mod:

 (((oryLat2:0.3,(HLnotFur1:0.3001,HLxipMac2:0.3001)HLnotFur1-HLxipMac2:0.0001)oryLat2-HLnotFur1:0.05,(gasAcu1:0.01,tetNig2:0.02)gasAcu1-tetNig2:0.1)oryLat2-gasAcu1:0.4,danRer7:0.5)oryLat2-danRer7;

并在R中做:

R
library(ape)
# Read the tree
tree <- read.tree( "tree.mod" )

# Extract a clade of 3 species
clade <- extract.clade( phy=tree, node="oryLat2-HLnotFur1")

# Measurements
x <- c(1,4,4)

# Covariance of the clade
V = vcv(clade)
      oryLat2 HLnotFur1 HLxipMac2
oryLat2       0.3    0.0000    0.0000
HLnotFur1     0.0    0.3002    0.0001
HLxipMac2     0.0    0.0001    0.3002

# Replace zero-entries
V[V==0] = 1e-5
      oryLat2 HLnotFur1 HLxipMac2
oryLat2     3e-01   0.00001   0.00001
HLnotFur1   1e-05   0.30020   0.00010
HLxipMac2   1e-05   0.00010   0.30020

# Formulas

# Weights
r <- 1/V
           oryLat2    HLnotFur1    HLxipMac2
oryLat2       3.3        100000   100000
HLnotFur1     100000     3.3      10000
HLxipMac2     100000     10000     3.3

#Mean
meanX = sum(x %*% r) / sum(r)
2.500008

我很困惑因为meanX = 2.5,这对应于高相关的情况,而在那个例子中,协方差矩阵几乎是对角线,所以我希望meanX = 3.

我必须遗漏一些东西,欢迎任何意见! 感谢

0 个答案:

没有答案
相关问题