R

时间:2017-10-08 09:25:10

标签: r cross-product

我最近提出了一个问题,即交叉刺激似乎表现得很奇怪。

> is.symmetric.matrix(crossprod(M1))
[1] TRUE
> is.symmetric.matrix(crossprod(M1,M1))
[1] FALSE

> dput(M1)
  

结构(c(0.662345679012346,-0.0537037037037037,   -0.0537037037037037,   -0.0537037037037037,-0.0537037037037037,-0.0537037037037037,   -0.0537037037037037,-0.0537037037037037,-0.0555533333333333,   -0.0555533333333333,-0.0555533333333333,-0.0555533333333333,   -0.0555533333333333,-0.0555533333333333,-0.0555533333333333,   -0.0555533333333333,-0.082849523255722,0.209560558823297,0.7794380722981334,   0.794380722981334,-0.082849523255722,0.209560558823297,-0.082849523255722,   -0.082849523255722,-0.0333333333333333,0.05,-0.0333333333333333,   0.133333333333333,-0.0333333333333333,-0.0333333333333333,   -0.0333333333333333,0.05,0.0722926923433098,1.91575634709772,   0.00722926923433098,-0.513278115637501,-0.686780577261445,   -0.339775654013557,-0.686780577261445,-0.686780577261445,0.138472834067548,   -0.0585636096649313,0.0727940194900547,-0.124242424242424,   0.0727940194900547,0.00711520491256175,-0.124242424242424,   -0.124242424242424,-0.665219916932936,-1.33980912847056,-0.271709543535988,   0.0655850622328247,-2.29547717814886,-2.29547717814886,-1.73331950186751,   1.58341078819248,-0.0829545454545454,-0.0829545454545454,-0.0829545454545454,   -0.0829545454545454,0.0725852272727273,-0.0829545454545454,   -0.0829545454545454,-0.0829545454545454,-0.865647461169836,   -1.73543677622087,4.41521623735429,-1.48692554334914,-0.555008420080178,   -4.46906033780982,-3.72352663919465,2.92414884012395,-0.00937499999999999,   -0.00937499999999999,-0.00937499999999999,0.693375,-0.15,-0.00937499999999999,   -0.15,-0.15,-8.09053494329047,-6.04111906819099,0.852370693507286,   0.666060159407333,-3.24646105669169,-2.31490838619192,-10.13995081839,   -3.24646105669169),. Dim = c(8L,11L),. Dimnames = list(NULL,       NULL))

之前有人遇到过这样的问题。我已输出输出以重现此问题。它仅对少数类型的矩阵失败。虽然有很多选择,但我想知道在执行crossprod(X,X)而不是crossprod(X)时我是否遗漏了任何东西

  

$ version.string [1]" R版本3.4.0(2017-04-21)"

0 个答案:

没有答案