I’m trying to compute eigenvalues of a nonsymmetric matrix but get the following error when sampling:
Exception: vector assign columns: assigning variable lambda (1) and right hand side columns (2) must match in size
model{
matrix[2,2] A;
complex_vector[2] lambda;
A = [ [2,1],[1,0] ];
lambda = eigenvalues(A);
}
The eigenvalue()
function should return a complex_vector
and not a complex_row_vector
. However, when I I print out the dimensions of eigenvalue(A)
I get 1 row and 2 cols, so I’m confused. Declaring complex_row_vector[2] lambda
also doesn’t work and throws an error at compilation.
Can anyone help me out here?
I’m using cmdstan 2.32.1