eigenvector

Preventing scipy eigenvectors differing from computer to computer

杀马特。学长 韩版系。学妹 提交于 2019-12-12 09:48:41
问题 Following up on this question about how to find the Markov steady state, I'm now running into the problem that it works perfectly on my lab computer, but it doesn't work on any other computer. Specifically, it always finds the correct number of near-one eigenvalues, and thus which nodes are attractor nodes, but it doesn't consistently find all of them and they aren't grouped properly. For example, using the 64x64 transition matrix below, the computers in which it doesn't work it always

Auto-vectorization in visual studio 2012 on vectors of Eigen type is not performing well

六月ゝ 毕业季﹏ 提交于 2019-12-12 04:25:58
问题 I have std::vector of Eigen::vector3d types and when i am compiling this code using Microsoft Visual Studio 2012 having the /Qvec-report:2 flag on for reporting vectorization details. It's showing Loop not vectorized due to reason 1304 (Loop contains assignments that are of different types) as specified on the msdn page -https://msdn.microsoft.com/en-us/library/jj658585.aspx My code is as below: #include <iostream> #include <vector> #include <time.h> #include<Eigen/StdVector> int main(char

eigenvectors complex nonsymmetric matrix in R different from Matlab: how to solve the this? [duplicate]

强颜欢笑 提交于 2019-12-11 17:53:56
问题 This question already has an answer here : R and MATLAB returning different eigenvectors (1 answer) Closed 2 years ago . I want to compute the eigenvalues of a complex matrix in R. Comparing the values obtained in MATLAB, I don't get the same eigenvalues obtained in R computing it from the exact same matrix. In R, I used eigen() . In MATLAB used eig() or eigs() (both functions give out the same eigenvalues but different to the R ones). For real matrices, R and MATLAB are consistent. How to

Numpy - Modal matrix and diagonal Eigenvalues

寵の児 提交于 2019-12-11 10:40:40
问题 I wrote a simple Linear Algebra code in Python Numpy to calculate the Diagonal of EigenValues by calculating $M^{-1}.A.M$ (M is the Modal Matrix) and it's working strange. Here's the Code : import numpy as np array = np.arange(16) array = array.reshape(4, -1) print(array) [[ 0 1 2 3] [ 4 5 6 7] [ 8 9 10 11] [12 13 14 15]] eigenvalues, eigenvectors = np.linalg.eig(array) print eigenvalues [ 3.24642492e+01 -2.46424920e+00 1.92979794e-15 -4.09576009e-16] print eigenvectors [[-0.11417645 -0

Eigenvector (Spectral) Decomposition

此生再无相见时 提交于 2019-12-10 11:29:52
问题 I am trying to find a program in C code that will allow me to compute a eigenvalue (spectral) decomposition for a square matrix. I am specifically trying to find code where the highest eigenvalue (and therefore its associated eigenvalue) are located int the first column. The reason I need the output to be in this order is because I am trying to compute eigenvector centrality and therefore I only really need to calculate the eigenvector associated with the highest eigenvalue. Thanks in advance

Is scipy.linalg.eig giving the correct left eigenvectors?

时光怂恿深爱的人放手 提交于 2019-12-10 08:31:14
问题 I have a question regarding the way how scipy.linalg.eig computes left and right eigenvectors. Maybe I misunderstood everything, but things seem not to be right to me... From the beginning. To get eigenvalues and both eigenvectors I used the following: ev, left_v, right_v = scipy.linalg.eig(A, left=True) According to the manual, after setting left=True while calling the function I should expect to get left eigenvectors as columns of left_v where the ith column refers to the ith eigenvalue.

Python eigenvectors

点点圈 提交于 2019-12-09 16:45:21
问题 eigenvalues, eigenvectors = linalg.eig(K) How can I print just eigenvectors of len(K) . So if there is K , 2x2 matrix, I get 4 eigenvectors, how can I print just 2 of them if there is len(K)=2 .... Many thanks 回答1: You are getting two vectors of length two, not four vectors. For example: In [1]: import numpy as np In [2]: K=np.random.normal(size=(2,2)) In [3]: eigenvalues, eigenvectors = np.linalg.eig(K) In [4]: eigenvectors Out[4]: array([[ 0.83022467+0.j , 0.83022467+0.j ], [ 0.09133956+0

Issue with Jama's Eigenvalue decomposition function

邮差的信 提交于 2019-12-07 23:22:31
问题 I am getting a wrong eigen-vector (also checked by running multiple times to be sure) when i am using matrix.eig() . The matrix is: 1.2290 1.2168 2.8760 2.6370 2.2949 2.6402 1.2168 0.9476 2.5179 2.1737 1.9795 2.2828 2.8760 2.5179 8.8114 8.6530 7.3910 8.1058 2.6370 2.1737 8.6530 7.6366 6.9503 7.6743 2.2949 1.9795 7.3910 6.9503 6.2722 7.3441 2.6402 2.2828 8.1058 7.6743 7.3441 7.6870 The function returns the eigen vectors: -0.1698 0.6764 0.1442 -0.6929 -0.1069 0.0365 -0.1460 0.6478 0.1926 0.6898

Matlab Codgen eig() function - strange behaviour

孤街浪徒 提交于 2019-12-07 23:15:50
问题 First, don't be fooled by the long post, there is not a lot of code just an observation of results so there are few example matrices. This is a bit related to this question: Matlab Codegen Eig Function - Is this a Bug? I know that mex/C/C++ translated eig() function may not return the same eigenvectors when using the same function in MATLAB and that's fine, but i am puzzled with results I'm getting. First this simple example: Output % c = diagonal matrix of eigenvalues % b = matrix whose

find Markov steady state with left eigenvalues (using numpy or scipy)

為{幸葍}努か 提交于 2019-12-06 13:32:05
问题 I need to find the steady state of Markov models using the left eigenvectors of their transition matrices using some python code. It has already been established in this question that scipy.linalg.eig fails to provide actual left eigenvectors as described, but a fix is demonstrated there. The official documentation is mostly useless and incomprehensible as usual. A bigger problem than than the incorrect format is that the eigenvalues produced are not in any particular order (not sorted and