是什么促使你提出这个愿望清单请求?
这是来自Nice Corporation的上原浩二先生的请求。
请描述您希望看到的新功能或改进功能或解决方案。
当您想要检验两个距离矩阵之间的关系时,可以使用 Mantel 检验。以下是一个示例脚本(由我编写)。
Clear Symbols();
Names Default To Here(1);
///////////////////////////////////////////////////////
// Sample Data
Random Reset(11111111);
n = 8;
x1 = (1::n)`+J(n,1,Round(Random Normal(0,3),1));
x2 = (1::n)`+J(n,1,Round(Random Normal(0,3),1));
// The followings are two input ditance matrices.
d1 = Sqrt(Distance(x1,x1));
d2 = Sqrt(Distance(x2,x2));
///////////////////////////////////////////////////////
cacl permutation corr = Function({d1, d2, NSim=100000, seed=1111111}, {Default Local},
p = NCol(d1);
y1 = J(p*(p-1)/2,1,.);
y2 = J(p*(p-1)/2,1,.);
k = 0;
For(i = 1, i <= p - 1, i++,
For(j = i+1, j<=p, j++,
k++;
y1[k] = d1[i,j];
y2[k] = d2[i,j];
)
);
sr = Correlation(y1||y2)[1,2];
two tail = 0;
greater = 0;
smaller = 0;
eps = 1e-8;
r0 = J(NSim,1,.);
For(ii = 1, ii <= NSim, ii++,
Wait(0);
If(Mod(ii,5000)==0, Write("Simulation:"||Char(ii)||"\!N"));
Wait(0);
ind = Random Shuffle(1::NCol(d1));
d22 = d2[ind,ind];
y2 = J(p*(p-1)/2,1,.);
k = 0;
For(i = 1, i <= p - 1, i++,
For(j = i+1, j<=p, j++,
k++;
y2[k] = d22[i,j];
)
);
pr = Correlation(y1||y2)[1,2];
r0[ii] = pr;
two tail += (Abs(pr) >= Abs(sr)-eps);
greater += pr >= sr-eps;
smaller += pr <= sr+eps;
);
Eval List({two tail/NSim, greater/NSim, smaller/NSim, r0})
);
{two tailed p, one tailed greater p, one tailed smaller p, r0}
= cacl permutation corr(d1, d2, NSim=100000, seed=1111111);
Show(two tailed p, one tailed greater p, one tailed smaller p);
dt = As Table(r0,<
<COLUMN names=""></COLUMN>
<BR /> <P><STRONG>如果提供这项新功能,对您和/或其他用户来说有什么价值?</STRONG> </P> <P>我不知道。</P> <BR /> <P><STRONG>这是外部客户提出的要求吗?</STRONG> </P> <P>是的,Nice Corporation 的上原浩二先生提出了这个功能要求。</P> <BR /> <P><STRONG>是否有其他具有类似功能或解决方案的同类软件值得我们关注?</STRONG></P> <P>我认为可以用 R 语言实现。</P> <BR /> <P><STRONG>这是否会影响客户的续约、扩展或采用?如果我们不解决这个问题,是否会给客户账户带来风险?</STRONG></P> <P>不。</P> <BR />
我发现曼特尔的测试大约是在四年前提出的。
https://jmpdiscovery.atlassian.net/browse/JMP-9834
用户可以使用 JMP Pro(至少现在如此),而 JMP Pro 中现在有了距离矩阵平台,因此实现用户要求距离矩阵支持 Mantel 测试的最短路径似乎是此。