So I am using MATLAB for a project and am discussing the use of the power method for finding stationary distributions of Markov chains and its convergence rate. I was wondering what method/algorithms MATLAB's eig() function uses to find the eigenvectors of a matrix?
Normally Matlab is using LAPACK routines to do calculation. With that in mind I guess that from here you will be able to find the code that matlab runs. Be Aware LAPACK is in Fortran.
MATLAB Incorporates LAPACK
Related
I like to use cuSolver code for Eigen value decomposition of complex matrix in Matlab.
I am using MATLAB CUDA kernel and it seems that its not possible to interface cuSolver with MATLAB as the cuSolver contains the code for host as well as for device (as mentioned here: http://docs.nvidia.com/cuda/cusolver/#syevd-example1)
while MATLAB CUDA kernel works only for the kernel function..
Please comment.
Any other idea to compute Eigenvalue decomposition of large no of matrices containing complex data in parallel on GPU by using Matlab environment?
You almost certainly need to use the MEX interface. This allows you to take in gpuArray data, and call kernels and other CUDA library functions.
See the doc: http://uk.mathworks.com/help/distcomp/run-mex-functions-containing-cuda-code.html for more.
I am trying to implement bayesian optimization using gauss process regression, and I want to try the multiple output GP firstly.
There are many softwares that implemented GP, like the fitrgp function in MATLAB and the ooDACE toolbox.
But I didn't find any available softwares that implementd the so called multiple output GP, that is, the Gauss Process Model that predict vector valued functions.
So, Are there any softwares that implemented the multiple output gauss process that I can use directly?
I am not sure my answer will help you as you seem to search matlab libraries.
However, you can do co-kriging in R with gstat. See http://www.css.cornell.edu/faculty/dgr2/teach/R/R_ck.pdf or https://github.com/cran/gstat/blob/master/demo/cokriging.R for more details about usage.
The lack of tools to do cokriging is partly due to the relative difficulty to use it. You need more assumptions than for simple kriging: in particular, modelling the dependence between in of the cokriged outputs via a cross-covariance function (https://stsda.kaust.edu.sa/Documents/2012.AGS.JASA.pdf). The covariance matrix is much bigger and you still need to make sure that it is positive definite, which can become quite hard depending on your covariance functions...
I have a function fun(x,y,z), such that say, x=1:10, y=50:60, z=100:105. Which optimization method (and how) I can use to get the minimum of this function, for example, where (x,y,z)=(3,52,101). I am working in Matlab.
Thank you for any help
Algorithms
There are many many algorithms out there that you can use for direct search optimization such as Nelder-Mead, Particle Swarm, Genetic Algorithm, etc.
I believe Nelder-Mead is a simplex optimization method which is used by fminsearch function in MATLAB.
Also, there is Genetic Algorithm which comes with MATLAB Global Optimization toolbox. You may want to give that a try as well.
Particle Swarm Optimization (PSO) is another direct search method that you can use. However, there is no official toolbox for Particle Swarm method built by Mathworks. The good news is there is quite a few PSO toolbox developed by other people. I personally have used this one and am quite happy with the performance. Its syntax is similar to Genetic Algorithm functions that come with Global Optimization Toolbox.
Discrete Optimization
Regarding your question that you are looking for a set of integer values namely x,y, and z corresponding to the minimum objective function value, I would add a part at the beginning of the objective function that rounds the variables to the closest integers and then feeds them to your main function fun(x,y,z). This way you would discretize your function space.
I hope my answer helps.
The lsqcurvefit Matlab function is used to fit the paramaters of a model curve to a real curve (acquired data from experiment or observation) so that de square differences are minimized. lsqcurvefit
The function is time consuming, and maybe prohibitive if used on large set of curves.
Can it be straightforwardly used inside a CUDA kernel, being then all the program coded in Matlab? (Edit: this is, without writing a custom version of lsqcurvefit in C for the kernel. For instance: write the kernel code in Matlab (using there "any" matlab function like lsqcurvefit()), then compile the kernel with a Matlab provided tool, and finally execute the kernel in the GPU, called from matlab host code).
Thanks
There are many ways to combine the capabilities of matlab with GPUs, but there isn't any matlab code that can be used in a CUDA kernel.
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?