I am a data scientist working on time series forecasting (using R and Python 3) at the London Ambulance Service NHS Trust. I earned my PhD in cognitive neuroscience at the University of Glasgow working with fmri data and neural networks. I favour linux machines, and working in the terminal with Vim as my editor of choice.
This method concatenates two matrices along a dimension.
We can easily make a large matrix by 'tiling' a smaller matrix by a repeated series of concatenations. We make a copy of the original matrix, and in two loops concatenate it to the appropriate axis (starting by adding more columns, and then replicating this 'row of matrices' downwards. (The two loops are identical apart from the axis being specified, and so it's tempting to delete one of them and then loop over the remaining one two times. While this saves 2 lines of code and avoids replicating the loop, it's just a little harder to grasp what's going on. So we go for clarity/readability over brevity):
We create a matrix and tile it:
Outputs:
< Is matrix triangular, diagonal, symmetric?
back to project main page
back to home