代码之家  ›  专栏  ›  技术社区  ›  Yorgos

R中复矩阵的行列式

  •  6
  • Yorgos  · 技术社区  · 16 年前

    有没有一种计算复矩阵行列式的方法?

    F4<-matrix(c(1,1,1,1,1,1i,-1,-1i,1,-1,1,-1,1,-1i,-1,1i),nrow=4)
    det(F4)
    Error in determinant.matrix(x, logarithm = TRUE, ...) : 
      determinant not currently defined for complex matrices
    
    library(Matrix)
     determinant(Matrix(F4))
    Error in Matrix(F4) : 
      complex matrices not yet implemented in Matrix package
    Error in determinant(Matrix(F4)) : 
      error in evaluating the argument 'x' in selecting a method for function 'determinant'
    
    2 回复  |  直到 13 年前
        1
  •  4
  •   Martin Mächler    16 年前

    我建议 prod(eigen(F4, only.values=TRUE)$values)
    相反。

    qr() 提倡使用 敌我识别 你只对 绝对值或更确切地说 Mod() :

     prod(abs(Re(diag(qr(x)$qr))))
    

    给予 Mod(determinant(x))

    通常,计算行列式是 解决一个给定的问题。

    在帮助(决定因素)页面上?

        2
  •  3
  •   Jan Gorzny    16 年前

    this 解决你的问题。我想你还是会想要更好的,但这可能是个开始。

    推荐文章