Hello,

I have access to GAUSS 15 and since I need to construct a diagonal matrix containing weights in the main diagonal I wondered what is the maximum of number of elements that GAUSS 15 is able to allow to construct this matrix. My data set has as n = almost 1o million obs. Therefore, the diagonal matrix should be n by n with a main diagonal vector with weights of this size. Is it possible to construct it using GAUSS 15? If so, how? Thanks

## 1 Answer

0

GAUSS does not have any internal matrix size maximum. However, GAUSS matrices are created in memory. So you will be limited by the memory available on your computer.

A 1 million by 1 million matrix will take about 8 terabytes of space, so your computer will probably not be able to handle that size of data. However, since the only nonzeros are on the diagonal, you can store this data as a vector. A 1 million element vector will only take up 8 megabytes which is quite small on a modern computer.

You can probably perform your matrix computations using element-by-element operations. For example:

//Create 4x4 matrix x = rndn(4,4); d = { 1 0 0 0, 0 2 0 0, 0 0 3 0, 0 0 0 4 }; v = { 1, 2, 3, 4 }; //Matrix multiply z_1 = d * x; //Equivalent element-by-element operation z_2 = v .* x;

Your code will, of course, be different.