2019-02-28
阅读量:
4529
评论(1)
发表评论
啊啊啊啊啊吖
2019-02-28
要计算矩阵的功效,您可以使用expm包或matrixcalc包:
A <- toeplitz(c(1,2,3)) # a square matrix
A
# [,1] [,2] [,3]
# [1,] 1 2 3
# [2,] 2 1 2
# [3,] 3 2 1
library(expm)
A %^% 2
# [,1] [,2] [,3]
# [1,] 14 10 10
# [2,] 10 9 10
# [3,] 10 10 14
library(matrixcalc)
matrix.power(A, 2)
# [,1] [,2] [,3]
# [1,] 14 10 10
# [2,] 10 9 10
# [3,] 10 10 14
0.0000
0
0
推荐帖子
0条评论
0条评论
1条评论