参考资料:https://math.vanderbilt.edu/sapirmv/msapir/prtrace.html

Here is the theorem about traces.

 Theorem. The following properties of traces hold:

  1. tr(A+B)=tr(A)+tr(B)
  2. tr(kA)=k tr(A)
  3. tr(AT)=tr(A)
  4. tr(AB)=tr(BA)

 Proof. Properties 1,2 and 3 immediately follow from the definition of the trace. Let us prove the fourth property:

The trace of AB is the sum of diagonal entries of this matrix. By the definition of the product of two matrices, these entries are:

               A(1,1)B(1,1)+A(1,2)B(2,1)+...+A(1,n)B(n,1),A(2,1)B(1,2)+A(2,2)B(2,2)+...+A(2,n)B(n,2),..........................................A(m,1)B(1,m)+A(m,2)B(2,m)+...+A(m,n)B(n,m)

Then the trace of AB is the sum of all these n2 products. We can compute the sum of these products in a different way: first compute the sum of the products in each column and then take the sum of these sums:

               A(1,1)B(1,1)+A(2,1)B(1,2)+...+A(m,1)B(1,m)+A(1,2)B(2,1)+A(2,2)B(2,2)+...+A(m,2)B(2,m)+...........................................A(1,n)B(n,1)+A(2,n)B(n,2)+...+A(m,n)B(n,m)

But this is exactly the trace of BA (the sum in the first row is the first diagonal entry of BA, the sum in the second row is the second diagonal entry, etc.):

               
               A(1,1)B(1,1)+A(2,1)B(1,2)+...+A(m,1)B(1,m),A(1,2)B(2,1)+A(2,2)B(2,2)+...+A(m,2)B(2,m),...........................................A(1,n)B(n,1)+A(2,n)B(n,2)+...+A(m,n)B(n,m)

So indeed tr(AB)=tr(BA).

For A, B such that AB is square, prove trAB = trBA.相关推荐

  1. python sklearn 梯度下降法_Python- sklearn之梯度下降算法原理

    给定一个矩阵A∈Rm×n,以及一个向量x∈Rn,他们乘积为一个向量y = Ax∈Rm.也即如下的表示: 如果A为行表示的矩阵(即表示为 ),则y的表示为: 相对的,如果A为列表示的矩阵,则y的表示为: ...

  2. 梯度下降算法和正规方程组学习笔记

    梯度下降算法学习笔记 内容来自于斯坦福大学<机器学习与数据挖掘公开课>. 介于算法中用到了许多线性代数的知识.所以我感觉有必要先对线性代数的基础知识做一个回顾和梳理. 1基础概念和记号 线 ...

  3. 第九讲:因子分析(Factor analysis)

    如果有一个多个高斯模型混合(a mixture of several Gaussians)而来的数据集 x ( i ) ∈ R n x^{(i)} ∈ R^n x(i)∈Rn ,那么就可以用期望最大化 ...

  4. 正规方程组(The normal equations)

    2. 正规方程组 上一节的梯度下降是一种最小化成本函数JJ的方法.这一节我们将介绍另一种算法也可以实现该功能且不需要使用迭代.正规方程组通过计算成本函数对每个θj\theta_j的偏导数,求出偏导为零 ...

  5. 【转载】线性代数基础知识

    转:https://www.cnblogs.com/hhddcpp/p/5742717.html 时间:2016年6月 翻译:@MOLLY(mollyecla@gmail.com) @OWEN(owe ...

  6. 机器学习中的矩阵求导的一点总结(三种方法求线性回归最佳参数)

    机器学习中的矩阵求导的一点总结(三种方法求线性回归最佳参数) 转载于:https://blog.csdn.net/promisejia/article/details/80159619?ops_req ...

  7. 矩阵的迹和导数的主要性质

    主要公式: Trace: trAtrAtraAtrA+BtrABtrABCtrABCD=======∑i=1naiitrATatrAtrA+trBtrBAtrBCA=trCABtrDABC=trCDA ...

  8. 斯坦福大学CS224d基础1:线性代数知识

    作者:Zico Kolter (补充: Chuong Do) 时间:2016年6月 翻译:@MOLLY(mollyecla@gmail.com) @OWEN(owenj1989@126.com) 校正 ...

  9. 机器学习基础(一)——线性代数

    学习机器学习,借此文章回顾线性代数知识. 出处:http://blog.csdn.net/han_xiaoyang/article/details/51629242 1基本概念和符号 线性代数可以对一 ...

  10. UA MATH571B 试验设计IV RCBD与Latin Square上

    UA MATH571B 试验设计IV RCBD与Latin Square上 RCBD Latin Square Design Graeco-Latin Square Design BIBD RCBD ...

最新文章

  1. 《Cortex-M0权威指南》之体系结构---异常和中断
  2. 常见算法:C语言求最小公倍数和最大公约数三种算法
  3. Enterprise Library 5.0 开发向导- 简介(1)
  4. CSS之media query模板
  5. CodeVS 1300 文字排版 线性DP
  6. java websphere mq_如何在java中使用WebSphere MQ?
  7. underscore javascript工具库支持seajs模块化
  8. Python——用assert语句来确保参数符合当前程序的要求
  9. Java+包裹类型_java中的包裹类型
  10. JavaEE持久层框架对比与hibernate主键生成策略总结
  11. catboost原理
  12. 一个人的精神结构和他的精神资源
  13. 如何在物联网平台创建一个千里传音产品?
  14. 超写实虚拟人制作教程
  15. 秉承极简美学设计:Polestar 2 登陆中国后会威胁到谁?
  16. AIX日志型文件系统的nbpi
  17. Java是编译性语言还是解释型语言 ?
  18. 点亮led灯的个数_LED灯的点亮电流一般是多少
  19. java开发系统内核:放大招!为系统开发星球大战游戏程序
  20. 2022-2027年中国北京养老机构行业市场深度分析及投资战略规划报告

热门文章

  1. 爱加密加固病毒分析-脱壳篇
  2. /etc/sudoers文件解析
  3. JS Worker执行多线程
  4. Unity3D 官方案例实现类似红警的移动
  5. 计算机主机usb端口使用不了,电脑USB接口不能用怎么办解决教程
  6. 计算机usb接口不工作原理,电脑usb接口不能用,详细教您电脑usb接口不能用怎么办...
  7. 微信小程序:关注公众号组件自定义样式
  8. paip 破解网站手机验证码
  9. 基因表达相关性——笔记
  10. 看图说话之二叉树的前序,中序,后序,层次遍历方式