3

I want to calculate y' * diag(A' * B * A) * y

  • y is a N * 1 vector
  • A is a m * N matrix where N >> m
  • B is a m * m matrix, and B is a symmetric positive definite matrix, the Cholesky decomposition B = L * L' is precomputed if it is needed.

Is it possible to calculate the above expression in O(N*m) complexity?

Alaya
  • 3,287
  • 4
  • 27
  • 39
  • 1
    I'd have thought this was probably better asked on the MathWorks site. – nekomatic Apr 04 '18 at 13:51
  • Are there any memory limitations? In case somebody decides to benchmark various implementations - could you provide typical sizes for `N` and `m`? If you end up having to do the matrix multiplication inside `diag`, you should store `T=A.' B`, then perform `T * T.'` as mentioned [here](http://www.walkingrandomly.com/?p=4912). You might also want to investigate the [BLAS library](http://www.netlib.org/blas/) and look for routines that perform this specific (or a similar) computation. [This Q&A](https://stackoverflow.com/q/42569698/3372061) might be related. – Dev-iL Apr 08 '18 at 08:49
  • @Dev-iL typical sizes are N = 2000 and m = 100 – Alaya Apr 08 '18 at 12:00
  • Just to clarify, what dimension do you expect the result to be? – Tokkot Oct 12 '18 at 14:46

0 Answers0