Cholesky分解(Cholesky decomposition / Cholesky )
Cholesky decomposition
In linear algebra, the Cholesky decomposition or Cholesky is a decomposition of a Hermitian, positive-definite matrix into the product of a lower triangular matrix and its conjugate transpose.
Cholesky 分解是把一个对称正定的矩阵表示成一个下三角矩阵L和其转置的乘积的分解。
wiki
https://en.wikipedia.org/wiki/Cholesky_decomposition
MATLAB
https://www.mathworks.com/help/matlab/ref/chol.html?s_tid=gn_loc_drop#responsive_offcanvas
Cplusplus
https://eigen.tuxfamily.org/dox/classEigen_1_1LLT.html
#include <iostream>
#include <vector>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
MatrixXd A(3,3);
A << 4,-1,2, -1,6,0, 2,0,5;
cout << "The matrix A is" << endl << A << endl;
LLT<MatrixXd> lltOfA(A); // compute the Cholesky decomposition of A
//cout << "lltofA" << endl << lltOfA(A) << endl;
MatrixXd L = lltOfA.matrixL(); // retrieve factor L in the decomposition
// The previous two lines can also be written as "L = A.llt().matrixL()"
cout << "The Cholesky factor L is" << endl << L << endl;
cout << "To check this, let us compute L * L.transpose()" << endl;
cout << L * L.transpose() << endl;
cout << "This should equal the matrix A" << endl;
}
MATLAB Cholesky分解
>> A = [4 -1 2 ; -1 6 0 ; 2 0 5 ]
A =
4 -1 2
-1 6 0
2 0 5
>> L = chol(A,'lower')
L =
2.00000 0.00000 0.00000
-0.50000 2.39792 0.00000
1.00000 0.20851 1.98910
>> B = L * L'
B =
4.0000e+00 -1.0000e+00 2.0000e+00
-1.0000e+00 6.0000e+00 -2.5602e-17
2.0000e+00 -2.5602e-17 5.0000e+00
>>
Cholesky分解(Cholesky decomposition / Cholesky )的更多相关文章
- cholesky分解
接着LU分解继续往下,就会发展出很多相关但是并不完全一样的矩阵分解,最后对于对称正定矩阵,我们则可以给出非常有用的cholesky分解.这些分解的来源就在于矩阵本身存在的特殊的 结构.对于矩阵 ...
- 矩阵分解----Cholesky分解
矩阵分解是将矩阵拆解成多个矩阵的乘积,常见的分解方法有 三角分解法.QR分解法.奇异值分解法.三角分解法是将原方阵分解成一个上三角矩阵和一个下三角矩阵,这种分解方法叫做LU分解法.进一步,如果待分解的 ...
- Cholesky分解 平方根法
一种矩阵运算方法,又叫Cholesky分解.所谓平方根法,就是利用对称正定矩阵的三角分解得到的求解对称正定方程组的一种有效方法.它是把一个对称正定的矩阵表示成一个下三角矩阵L和其转置的乘积的分解.它要 ...
- 偏置-方差分解(Bias-Variance Decomposition)
本文地址为:http://www.cnblogs.com/kemaswill/,作者联系方式为kemaswill@163.com,转载请注明出处. 机器学习的目标是学得一个泛化能力比较好的模型.所谓泛 ...
- 偏置方差分解Bias-variance Decomposition
http://blog.csdn.net/pipisorry/article/details/50638749 偏置-方差分解(Bias-Variance Decomposition) 偏置-方差分解 ...
- 偏差-方差分解Bias-Variance Decomposition
转自: http://www.cnblogs.com/jmp0xf/archive/2013/05/14/Bias-Variance_Decomposition.html
- Jordan Lecture Note-12: Kernel典型相关分析(Kernel Canonical Correlation Analysis, KCCA).
Kernel典型相关分析 (一)KCCA 同样,我们可以引入Kernel函数,通过非线性的坐标变换达到之前CCA所寻求的目标.首先,假设映射$\Phi_X: x\rightarrow \Phi_X(x ...
- 【原创】开源Math.NET基础数学类库使用(15)C#计算矩阵行列式
本博客所有文章分类的总目录:[总目录]本博客博文总目录-实时更新 开源Math.NET基础数学类库使用总目录:[目录]开源Math.NET基础数学类库使用总目录 上个月 ...
- Scipy学习笔记 矩阵计算
Scipy学习笔记 非本人原创 原链接 http://blog.sina.com.cn/s/blog_70586e000100moen.html 1.逆矩阵的求解 >>>impor ...
随机推荐
- 单元测试mock框架——jmockit实战
JMockit是google code上面的一个java单元测试mock项目,她很方便地让你对单元测试中的final类,静态方法,构造方法进行mock,功能强大.项目地址在:http://jmocki ...
- 一个基于QT简单登录对话框(带验证码功能)
1. 对话框样式 2. 源代码 ①. main.cpp #include <QtGui/QApplication> #include "QLoginDialog.h" ...
- Java——flush()方法
Java在使用流时,缓冲区是一种发送数据的高效方法,但当溢出缓冲区的部分需要用flush()方法强制将数据发送出去,不必等到缓冲区再次装满,尤其是在数据量特别小的情况下,如果不使用此方法,很容易出现流 ...
- 一行CMD命令kill(杀)掉你的进程
查看进程 pi@raspberry:~ $ ps -ef | grep python3 UID PID PPID C STIME TTY TIME CMD pi 4678 4666 0 11:57 p ...
- tcp发送缓冲区学习
https://blog.csdn.net/ysu108/article/details/7764461 Nginx 模块开发书上有内容 陶辉博客也可以
- Android NDK开发 Jni中Debug(三)
下载LLDB 配置Android Native - Debugger 调式结果如下 #include <jni.h> #include <string.h> #include& ...
- C++中遇到的各种小问题
lpcwstr类型问题 在使用VS2010开发C++程序时,由于系统默认字符集是unicode字符集,造成与早期的字符串格式不兼容问题 ①Properties — Configuration Prop ...
- mac os安装macvim
1 brew install macvim 安装 macvim 2 alias vim='/usr/local/Cellar/macvim/7.4-73_1/MacVim.app/Contents/M ...
- linux_api之进程控制
本篇索引: 1.引言 2.进程标识 3.多进程 4.fork函数 5.vfork函数 6.exit函数 7.wait和waitpid函数 8.竞态 9.exec函数族 10.进程状态 11.syste ...
- 结合IL和Windbg来看.Net调用继承虚方法的执行顺序
先上测试代码: using System; using System.Collections.Generic; using System.Linq; using System.Text; using ...