s******d 发帖数: 2730 | 1 这么上纲上限的,我从来都是觉得以后会比以前好而已.
动不动就永恒什么的,把好好一个词都叫俗了. |
|
R********n 发帖数: 519 | 2 Matlab吧,上手很快,装了就能用,一句话
[V,D] = eig(X);V is eigen-vector matrix, D is eign-value matrix |
|
d******e 发帖数: 7844 | 3 这玩艺有啥难的啊。
先求kernel matrix,两个循环,五行,中心化,一行
再特征值分解,matlab有现成的函数,eig,一行。
然后用投影。一个循环就足够了,3行。 |
|
s********k 发帖数: 6180 | 4 请问下这个中心化是指特征空间中心化吗?有什么语句一行能实现,不是特别清楚。另
外eig出来的vector是按照eigvalue顺序排列的吗? |
|
P***P 发帖数: 1387 | 5 ..还是检查一下code吧, eig(rand(1000))在matlab里面不用一秒钟啊. cpu也是duo
core2 |
|
t****t 发帖数: 6806 | 6 要不要算eigenvector差别满大的. [e,v]=eig(rand(1000))就要三倍的时间了. |
|
p**o 发帖数: 3409 | 7 matlab曾经自己写过底层库,后来就直接用intel mkl里的blas和
lapack来对付稠密矩阵了。mkl是用fortran写的,也提供了c接口。
我没看过matlab的封装,不清楚它封的是哪个接口。
稀疏矩阵的话,我的理解是matlab会调umfpack来分块求解
(调amd来做preordering),其中每一块稠密矩阵又调mkl来算。
自己写/封装eig,性能超过matlab的可能性很小。
Fortran写的。 |
|
|
w**w 发帖数: 100 | 9 IT++ is a C++ library of mathematical, signal processing, speech processing,
and communications classes and functions.
http://itpp.sourceforge.net/
It can deal with matrix calculations very simple. Such:
M.eig() will give you the eigenvalues of M.
you can look the website.
I used TNT before, not bad. :)
every
solve
fortran |
|
c**z 发帖数: 1014 | 10 matlab can do that easily,
use the command eig.
If you don't have matlab,
maybe you can try scilab, which I think is free. |
|
m********e 发帖数: 5088 | 11 呵呵,只是自己比较懒,我情愿把lanczos当作一个黑盒,如果可以像matlab里面那样
[V,E]=eigs(M)就好了,一个命令多简单。可惜还要定义很多东西,麻烦 |
|
m********e 发帖数: 5088 | 12 100万*100万的算大型矩阵了,比较推荐Arpack(in Fortran77),但估计这么大的矩阵得
用64bit机器。
一般的32bit机器,4Gdual processor, 4G ram,最多可以解到30万*30万。
再小一点的10万,20万左右的,就可以用matlab*P解了
一般的Matlab如果用sparse+eigs,最多解10000*10000,再多没戏。
所以还是用fortran比较好。
如果我没猜错,应该是要解simultaneous eigenvalue equations吧。
好运
1000000*
最 |
|
T*********e 发帖数: 39815 | 13 比较难
你对 你那个矩阵A做个分解试试
B=A'*A;
[V D]=eig(B);
然后看看eigen value的最小值是多少? |
|
d****i 发帖数: 4809 | 14 假设一个对称正定矩阵
A=[2.3 0.5 1.6;
0.5 6.8 -0.56;
1.6 -0.56 1.55]
具有正的特征值,我用[Q,D]=eig(A)计算后得到:
D=0.196577515624112 0 0
0 3.56779043908682
0
0 0 6.
88563204528907
Q=-0.618399824240682 -0.78174464024621 -0.0803553036545658
0.112779123314768 0.0129112653881752 -0.
993536193890504
0.777729083115352 |
|
t***s 发帖数: 4666 | 15 show us your matrix.
my guess is that your matrix has many negative eigenvalues and is almost
sigular. |
|
c*******h 发帖数: 1096 | 16 use eigs() in matlab. very fast... |
|
c*******h 发帖数: 1096 | 17 ok, to be serious.
there are numerous ways.
the best way i prefer is to apply a few steps of lanczos iterations
and then solve the largest eigenvalue of a tridiagonal matrix.
i beleive matlab implements this in eigs(), since it uses arpack.
the
a |
|
d****i 发帖数: 4809 | 18 【 以下文字转载自 Computation 讨论区 】
发信人: domini (none), 信区: Computation
标 题: Matlab中计算特征值如何保持原始特征值顺序不变?
发信站: BBS 未名空间站 (Tue Jan 15 11:41:16 2008)
假设一个对称正定矩阵
A=[2.3 0.5 1.6;
0.5 6.8 -0.56;
1.6 -0.56 1.55]
具有正的特征值,我用[Q,D]=eig(A)计算后得到:
D=0.196577515624112 0 0
0 3.56779043908682
0
0 0 6.
88563204528907
Q=-0.618399824240682 -0.781744640246 |
|
a********r 发帖数: 387 | 19 我用matlab做矩阵对角化,得到的本征向量之间不是相互正交。请问这是什么原因阿?
这是我需要计算的矩阵
a =
32.2065 -42.0044 -0.0103
-31.2490 109.9704 -0.0004
0.0035 0.0049 182.1143
这是得到的结果,其中p是3组本征向量,d是对应的3组本征值:
>> [p,d]=eigs(a)
p =
-0.0001 0.4152 0.9469
0.0000 -0.9097 0.3215
1.0000 0.0001 -0.0000
d =
182.1143 0 0
0 124.2335 0
0 0 17.9434 |
|
z*******9 发帖数: 167 | 20 你的结论应该是错的。
举个反例
A =
1.0753 2.6961 -2.6924
2.6961 0.6375 -0.9651
-2.6924 -0.9651 7.1568
>> d = sum(A);Dh = diag(1./sqrt(d));eig(Dh*A*Dh)
ans =
3.5358
-1.2248
1.0000
不过如果A是非负矩阵,那么结论是对的。
你可以先证明:
L=D-A是半正定,且最小的特征值是0。(L is called Laplacian matrix)
半正定是因为 x'Lx = 0.5*\sum_{ij} A_{ij} (x_i-x_j)^2 >=0,
0是特征值是因为 Le=0, where e is column vector with all ones.
易知
D^{-1/2}LD^{-1/2}和L拥有相同的惯性系数,即都是半正定且最小特征值为0
而
D^{-1/2}LD^{-1/2} = I-D^{-1/2} A D^{-1/2},
所以D^{-1/2} A D^{-1/2} |
|
p**o 发帖数: 3409 | 21 我的D矩阵取了绝对值的。关于你的"反例":
>> A=[1.0753, 2.6961, -2.6924;
2.6961, 0.6375, -0.9651;
-2.6924, -0.9651, 7.1568];
>> D=diag(sum(abs(A)))
D =
6.4638 0 0
0 4.2987 0
0 0 10.8143
>> Ap=D^(-1/2)*A*D^(-1/2)
Ap =
0.1664 0.5115 -0.3220
0.5115 0.1483 -0.1415
-0.3220 -0.1415 0.6618
>> [U,L]=eig(Ap)
U =
0.7240 0.4198 -0.5473
-0.6769 0.5853 -0.4463
0.1330 0.6936 0.7080
L =
-0.3710 0 |
|
z*******9 发帖数: 167 | 22 还是有点错
L=D-A不一定是奇异的。
当且仅当sign(A)的rank为1的时候,等号才成立, see attachment.
否则等号不成立。一个例子是:
A =
5.5389 -0.6245 2.8300
-0.6245 -0.1261 0.5906
2.8300 0.5906 2.9794
>> d = sum(abs(A));Dh = diag(1./sqrt(d));D = diag(d);[U,S]=eig(Dh*A*Dh)
U =
0.3456 -0.5269 0.7765
0.8444 0.5355 -0.0125
-0.4093 0.6600 0.6299
S =
-0.2653 0 0
0 0.3313 0
0 0 0.9214
>> rank(sign(A))
ans =
3
=========================== |
|
p**o 发帖数: 3409 | 23 第一个例子举的很好,看来我主贴中提到的x_0构造得有问题
不过你这个关于rank的结论不正确吧,比如
A =
1 1 -1
1 1 0
-1 0 1
>> rank(A)
ans =
3
>> D=diag(sum(abs(A)))
D =
3 0 0
0 2 0
0 0 2
>> Ap=D^(-1/2)*A*D^(-1/2)
Ap =
0.3333 0.4082 -0.4082
0.4082 0.5000 0
-0.4082 0 0.5000
>> [U,S]=eig(Ap)
U =
0.7559 0.0000 -0.6547
-0.4629 0.7071 -0.5345
0.4629 0.7071 0.5345
S =
-0.1667 0 0
|
|
q**j 发帖数: 10612 | 24 打算把一个positive definite, symmetric 的矩阵分解成两个矩阵, i.e.,
A = B*B.
按照原理可以用eigen decomposition 把A分成 V*D*V^(-1)。其中D是diagonal的。因为
A是正定的所以D的对角线上面都是正数。所以定义E是D的平方根,
A= V*D*V(-1) = V*E*E*V(-1) = V*E*V(-1) * V*E*V(-1),所以定义
B = V*E*V(-1),就可以有A = B*B。
可是在matlab里面用了 [V,D]=eig(A)以后,出来的D不是diagonal的。应该是计算精度
的问题吧。这下怎么办?有没有好办法来对付这个问题?多谢了。 |
|
A***C 发帖数: 143 | 25 try
[U,S] = eig(0.5*(A+A'));
因为 |
|
R*******T 发帖数: 1171 | 26 小女子打算求一个ODE的特征值:
(d^4/dt^4) y(t)=lambda* y(t),t in [0,1]
边值条件是y'(0)=y'(1)=y''(0)=y''(1)=0
据说有个很神奇的软件叫chebfun()可以做,小女子于是编了下面这个code
trunc=30;
tic
L = chebop(@(x,u) diff(u,4), [0,1]);
L.lbc = @(u)[ diff(u,1), diff(u,2)];
L.rbc = @(u)[ diff(u,1), diff(u,2)]
[V,D] = eigs(L,trunc);
disp(diag(D)), toc
试试这个,不知道对不对。 |
|
n*********2 发帖数: 3 | 27 最近这段时间关注巴以问题比较多,没怎么关心物理。
但是今天再次看到borland这个名字,决定写点有关他的东西,以完成很久以来的一个
心愿。
这是一个非常深刻非常有趣非常困难的反问题。
我刚开始在物理所做研究生的时候,在图书馆看到过一本书,名字叫reduced density
matrices: Coulson‘s challenge。里面讨论的是这样一个问题。学过量子力学的人
都知道密度矩阵,这个非常本质的概念是landau提出来的,曾经被landau学生列举为
landau十个贡献之一(所谓landau十诫)。对于一个包含有多个子系统的系统而言,我
们除了可以定义和讨论整个系统的密度矩阵之外,还可以定义和讨论单个子系统的密度
矩阵,也就是所谓的约化密度矩阵。定义约化密度矩阵的动机是,如果我们只关系子系
统的物理量的话,我们并不需要知道整个系统的密度矩阵。那包含了过多的冗余信息,
子系统的约化密度矩阵对我们的目的而言足够了。
约化密度矩阵的一个最常见的应用是对全同粒子系统,比如一个原子里的若干电子构成
的系统。对里面的单个电子,我们可以定义单粒子约化密度矩阵;对里面的任何一对电
子,... 阅读全帖 |
|
k**********g 发帖数: 33 | 28 Thanks for your reply.
I am sorry that I made a mistake.
A<=B should mean that B-A is Positive-definite matrix.
How about considering the maximum eig values? It's possible?
parallel |
|
h***s 发帖数: 35 | 29 Thanks, everyone. The second question has three solutions in Matlab help,
using property: If Y is invertible then eYXY−1 = YeXY−1.
Attach the detail solutions as following:
Matrix Exponentials
For background on the computation of matrix exponentials, see "Nineteen
dubious ways to compute the exponential of a matrix, twenty-five years later
," SIAM Review 45, 3-49, 2003.
The Pseudospectra Gateway is also highly recommended. The web site is:
http://web.comlab.ox.ac.uk/projects/pseudosp... 阅读全帖 |
|
a***w 发帖数: 30 | 30 I bet you can not use all the 5000 eigenvalues :)
If you use Matlab, you surely don't have
better ways than eig... or you can try to
compute only several largest or smallest ones...
SVD will make your computation slower:(
You can find some references on symmetry
eigenvalue problems, methds as Triangulization,
power iteration... and use C, there is a very famous book
on it |
|
k*******y 发帖数: 56 | 31 please forget about what I said, this is the standard proof:
consider the following matrix product
sorry for the messy notation
1
matrix(I,0,-B,xI, nrow=2)*matrix(xI,A,B,xI)
and 2
matrix(xI, -A,0,I) *(xI,A,B,xI)
their det differ by only a factor of a power of x
on the other hand the products are nothing but
matrix(xI,A,0,x^2I-BA)
and
matrix(x^2I-AB,0,B,xI)
now let x=sqrt(\lambda)
can get that the characteristic polymonials of AB and BA
differ only by a vector of \lambda^{m-n}
ie, the nonzero eig |
|
w*******y 发帖数: 60932 | 32 $100 Cashback with New Chase Freedom Credit Card Approval After You Spend $
500 in 3 Months. The next $100 is after you spend an additional $1000 in 6
Months.
I was looking to buy a new computer/laptop and a TV and thought this might
be useful and achievable. This is from the banner btw.
Chase:
https://applynowdc2.chase.com/FlexAppWeb/renderApp.do?SPID=DD3V&CELL=6H8X&
AFFID=lw9MynSeamY-ZB3trvBp_dEp2a1H5w.EIg&pvid=contestu818927t0f0fp0dd0c0s65
|
|
N***i 发帖数: 2063 | 33 Best-Rated Financial Stocks Updated June 23, 2010
http://www.nasd100.com/2010/06/bestrated-financial-stocks-updated-june-23-2010.html
Ranking | Company (Ticker) | Average Rating Value | Average Rating
1 IRSA Inversiones Representaciones (ADR) (NYSE:IRS) 1.00 Strong Buy
2 Primus Guaranty, Ltd. (NYSE:PRS) 1.00 Strong Buy
3 China Life Insurance Company Ltd. (ADR) (NYSE:LFC) 1.00 Strong Buy
4 National Bank of Greece (ADR) (NYSE:NBG) 1.00 Strong Buy
5 HDFC Bank Limited (ADR) (NYSE:HDB) 1.00 ... 阅读全帖 |
|
w***y 发帖数: 2537 | 34 【 以下文字转载自 Stock 讨论区 】
发信人: ll111 (Stealth), 信区: Stock
标 题: Events and ER for week August 2-6
发信站: BBS 未名空间站 (Sun Aug 1 22:47:17 2010, 美东)
Monday, Aug. 2
10 a.m.: ISM Manufacturing index on business activity in July, released by
the Institute for Supply Management.
10:15 a.m. Federal Reserve Chairman Ben Bernanke speaking on "challenges for
the economy and state governments."
4 p.m. Treasury Secretary Timothy Geithner speaking on the next steps for
financial reform.
Tuesday, Aug. 3
8:30 a.m.: P... 阅读全帖 |
|