I feel like I've gotten 'stuck' here; I can't seem to find anything in the docs to help.
I'm trying to calculate the eigenvectors of a square matrix. Currently I have my matrix defined as a function f[x;y].
Is there an equivalent of LAPACK's QR algorithm in KDB? (or alternatively, can I connect to LAPACK from KDB?)
You can use the qml library developed by Andrey Zholos located here: https://github.com/zholos/qml. It is built ontop of libraries such as LAPACK.
The function for calculating the eigenvectors is mev and the input parameter is the matrix
Related
I have computed colour descriptors of a dataset of images and generated a 152×320 matrix (152 samples and 320 features). I would like to use PCA to reduce the dimensionality of my image descriptors space. I know that I could implement this using Matlab PCA built-in function but as I have just started learning about this concept I would like to implement the Matlab code without the built-in function so I can have a clear understanding how the function works. I tried to find how to do that online but all I could find is the either the general concept of PCA or the implementation of it with the built-in functions without explaining clearly how it works. Anyone could help me with a step by step instructions or a link that could explain a simple way on how to implement PCA for dimensionality reduction. The reason why I'm so confused is because there are so many uses for PCA and methods to implement it and the more I read about it the more confused I get.
PCA is basically taking the dominant eigen vectors of the data (Or better yet their projection of the dominant Eigen Vectors of the covariance matrix).
What you can do is use the SVD (Singular Value Decomposition).
To imitate MATLAB's pca() function here what you should do:
Center all features (Each column of your data should have zero mean).
Apply the svd() function on your data.
Use the V Matrix (Its columns) as your vectors to project your data on. Chose the number of columns to use according to the dimension of the data you'd like to have.
The projected data is now you new dimensionality reduction data.
I have symmetrical sparse matrices. Some of the elements would form "blocks" or "components" .
Please look at the output of spy on example matrix.
I want to efficiently find those clusters in MATLAB.
This problem is equivalent to finding connected components of a graph, however I have a feeling that relevant functionality should be available as a (combination of) fast MATLAB built-in functions that operate on sparse matrices.
Can you suggest such combination?
OK, found graphconncomp function in bioinformatics toolbox. It uses some mex routines internally.
does anybody know an implementation for the Iterative Closest Point (ICP) algorithm in Matlab that computes the covariance matrix?
All i have found is the icptoolboxformatlab but it seems to be offline.
http://censi.mit.edu/research/robot-perception/icpcov/
There is matlab code for 2D case. It provide ICP's covariance too.
I have implemented the 3D variant of Point to Point error metric based ICP covariance estimation, which is inspired from Andrea Censi's work.
Have a look at
https://sites.google.com/site/icpcovariance/home
do you know if MATLAB supports the LAPACK spptrf function.
This function is quite a bargain when you gotta compute Cholesky factorization of a huge positive definite symmetric matrix.
It allows for the factorization by only giving the upper triangular matrix, stored as uni-dimensional matrix, as input.
Or, else, is chol built-in function already using spptrf internally?
EDIT
I have been able to find the lapack library on the File Exchange http://www.mathworks.com/matlabcentral/fileexchange/16777-lapack, with the desired implementation of the spptrf function.
EDIT 2
MATLAB running on my machine is fatally crashing each time I call spptrf.
Is there any alternative way to directly handle this function?
I've been trying to implement the Neighbourhood Component Analysis (NCA) algorithm in Octave, but apparently there's something wrong with my code and I cannot figure out what it is.
Note: I am using Carl Edward Rasmussen's minimize function for maximization of the negative f.
Note 2: The test data I am using is the Wine dataset available at the UCI Machine Learning repository.
With some external help, I've got the answer to the question. The problem was that I was assuming wrongly that vector product of the difference of datapoints i and j should be a row vector by column vector instead of the opposite: