The problem is I that the version of Matlab that I have does not have the mhsample function. I implemented a version of my own and I want it to be compatible with the version provided with the latest statistical tollbox, in the event that in the future I will have access to the toolbox and not having to modify the existing scripts and functions.
My question arose from the description of the mhsample function (<http://www.mathworks.com/help/stats/mhsample.html)>, which to me is not totally clear. It says that, and I quote: "smpl is a column vector or matrix containing the samples". Later, at the part where it explains the 'nchain' option it says, and I quote: "smpl is a matrix containing the samples. The last dimension contains the indices for individual chains.". What I understood is the following: if I generate one chain then smpl is a column vector, whereas if I generate several chains then smpl is a matrix. But then why do the indices of each individual chain have to be specified in the last column. Also what if the distribution I want to sample is a higher dimensional one, then how is smpl structured?
I will appreciate any piece of advice I receive. Thank you!