First time here? Check out the FAQ!
x

How do I calculate the Eigenvalues and Eigenvectors of a matrix using Smalltalk?

0 votes
1,291 views
Caution! Nerd Talk! :D

I'm trying to write a tool that does Principal Component Analysis (PCA) on a set of features. To simplify the problem I was thinking about working with a symetric matrix. So I got for example a 10x10 matrix where each row contains all the different feature values and each column represents an observation of those values in time. I'm able to compute the Covariance Matrix but now I'm struggling to find a smalltalk solution to compute the Eigenvalues and Eigenvectors of it. Any ideas?

I'm representing the matrix as arrays, one array each row BTW.

Thanks!
asked Nov 27, 2015 in Capytalk & Smalltalk by kymaguy (Virtuoso) (10,580 points)
Excellent resource - thanks!

2 Answers

0 votes
One approach would be to start with the C code or FORTRAN from Numerical Recipes and translate that into Smalltalk.
answered Nov 27, 2015 by ssc (Savant) (126,620 points)
This is a little bit more complicated then expected :)
Anyway I think I'm able to translate the Jacobi Transformation into smalltalk...
0 votes

Dear Gustl,

The attached file is a good read and should be very helpful. I think it is very good for diving deeper into Math with the help of Smalltalk in general.

Object-Oriented Implementation of Numerical Methods An Introduction with Smalltalk:

http://kyma.symbolicsound.com/qa/?qa=blob&qa_blobid=18201709124280133514

All the best

Chris

 

answered Nov 28, 2015 by christian-schloesser (Adept) (2,900 points)
edited Nov 28, 2015 by christian-schloesser
Thanks, Christian!

For Gustl & others looking to utilize the code examples in a Tool, you can translate their methods into block closures saved in global variables so you can evaluate later using the value: (as many keywords as there are arguments to block) message.
thanks christian, what an excellent book!!
@ssc that's a good hint! While looking at the jacobi transform I see that there is a 'matrix' class being used. do we have this kind of class in kyma too?
...