As stated in the title I have a retagular matrix of zeros. If the first dimension is time (T) in the second dimension I need to insert n by n identity matrices which start at certain points in the first dimension for a certain number of variables. If M is the set of all n's across variables. So the matrix will be timebins by sum(M).
For instance suppose I have 2 variables A and B where A requires 3x3 identity matrices and b requires 5x5 identity matrices. S All A matrixes will start at column position 7 and go down to 6, while B matrices will start at 5 and go down to 0. So my matrix will be T by (3+5).
mat = np.zeros([100,8])
# Instances of A occur at...
A= [20, 30, 70]
# Instances of B occur at...
B = [15, 60]
What is the most efficient way to insert identity matrices starting at 7 for A and 4 for into mat? So for instance the first example of A would have ones from [19,7], [20,6], [21,5]. While for B the diagonals would start in the second dimension at 4 and run to 0.