@@ -667,21 +667,21 @@ def markov(*args, m=None, transpose=False, dt=None, truncate=False):
|
667 | 667 | |
668 | 668 | # Set up the full problem |
669 | 669 | # Create matrix of (shifted) inputs |
670 | | -UUT = np.zeros((p*m,(l))) |
| 670 | +UUT = np.zeros((p*m, l)) |
671 | 671 | for i in range(m): |
672 | 672 | # Shift previous column down and keep zeros at the top |
673 | | -UUT[i*p:(i+1)*p,i:] = Umat[:,:l-i] |
| 673 | +UUT[i*p:(i+1)*p, i:] = Umat[:, :l-i] |
674 | 674 | |
675 | 675 | # Truncate first t=0 or t=m time steps, transpose the problem for lsq |
676 | | -YY = Ymat[:,t:].T |
677 | | -UU = UUT[:,t:].T |
| 676 | +YY = Ymat[:, t:].T |
| 677 | +UU = UUT[:, t:].T |
678 | 678 | |
679 | 679 | # Solve for the Markov parameters from YY = UU @ H.T |
680 | 680 | HT, _, _, _ = np.linalg.lstsq(UU, YY, rcond=None) |
681 | 681 | H = HT.T/dt # scaling |
682 | 682 | |
683 | | -H = H.reshape(q,m,p) # output, time*input -> output, time, input |
684 | | -H = H.transpose(0,2,1) # output, input, time |
| 683 | +H = H.reshape(q, m, p) # output, time*input -> output, time, input |
| 684 | +H = H.transpose(0, 2, 1) # output, input, time |
685 | 685 | |
686 | 686 | # for siso return a 1D array instead of a 3D array |
687 | 687 | if q == 1 and p == 1: |
|