-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New type of BlockTridiagonalKron (or something) #37
Comments
Why not do it the other way around: QR decomposition for |
Sorry, that was just a simple way to generate the matrix as something sparse, but there may be other ones. Your suggestion generated a different matrix, unless I made a mistake To be concrete here is some working code to create the matrices.
Can we set this up as a
But looking first at storage (with Q dense for now)
For a system of
I know how to do the matrix-vector multiplications to specialize the type, but as for algorithms for linear solves, there I am ignorant. But it seems to me that LU or QR algorithms could exploit that the off-block-diagonals bandwidths are just diagonals, or (even better) that off-block-diagonals are constant diagonals? |
My suggestion is equivalent to permuting the rows/columns to interchange the notion of blocks and entries in the blocks. Essentially a “transpose” if you reinterpret a blocked vector as a matrix. So the linear system is equivalent and you can take advantage of |
I think I "kind of" get what you are saying here for the kron part, but not sure about how the rest of it would work (i.e. the blockdiag in the way I have constructed it)
This may be out of my paygrade. But lets make a chance to my setup: Instead of And, if not, and the key really is in the use of |
I take that back. I now fully get what you are saying about interchanging the dimensions. But I still don't understand the code to work with different matrix types in the block-diagonal vs. off-diagonals. |
You probably want to use a Alternatively, your matrix will be Banded with bandwidth proportional to the block size, so you could just wrap a |
Combination code and basic linear algebra question for @dlfivefifty and any other experts: We have a very particular structure for some of my sparse matrices, which is common enough in economics to be worth specializing types:
Tridiagonal
matrices of size MxM,L_1, ... L_N
and a square (possibly dense) matrixQ
of size NxN, which is an intensity matrix of a markov chain (i.e. q_ii = - sum(q_ij | j != i))While I can represent this in a
BlockBanded
matrix, it is inefficient in space (since it has to have the same bandwidth for each block). More importantly, there is structure there that might be exploited to speed up linear solves.So, with that in mind, what do you think about both the feasibility and payoff of creating a specialized matrix type of that form that can exploit the structure for fast linear solves?
This is where I am entirely ignorant... But looking at https://github.com/JuliaMatrices/BlockBandedMatrices.jl/blob/master/src/blockskylineqr.jl#L19 it seems like the QR decomposition can be done in blocks in some way? The QR for every block other than the diagonal is trivial. Is this both something feasible without too much specialized knowledge, and likely to pay off big for the speed of linear solves?
If you think it worthwhile, we could create this type and add it to this package.
The text was updated successfully, but these errors were encountered: