# Classification of Event-Related Potentials with Regularized Spatiotemporal LCMV Beamforming
## 4 Discussion
### Time and Memory Complexity  
As mentioned above, inverting the full \(cs\times cs\) dimensional covariance matrix to construct stbf-emp and stbf-shrunk can be costly and unstable, in particular in high-resolution settings with many EEG channels or time samples. Constructing the full covariance and inverse covariance matrices also requires a considerable amount of memory. The structured covariance estimator of stbf-struct has two advantages here.  
First, because of Properties 1 and 2 there is no need to calculate the full \(cs\times cs\) symmetric covariance and inverse covariance matrices for stbf-struct or keep them in memory; they can instead be replaced by two smaller symmetric matrices of dimensions \(c\times c\) and \(s\times s\), respectively. Furthermore, since the temporal component of the Kronecker product is Toeplitz-structured, it only requires \(s\) parameters to estimate. Although the inverse covariance of stbf-emp and stbf-shrunk is defined by \(\frac{cs(cs+1)}{2}=\frac{32\times 17(32\times 17+1)}{2}=122.128\) parameters accounting for the symmetric nature of covariance, the structured estimator only requires \(\frac{c(c+1)}{2}+s=\frac{32(32+1)}{2}+17=545\) unique parameters. This reduction in parameters to estimate reduces memory usage and contributes to the regularization effect for low-data-availability settings. The inverse covariances of stbf-emp and stbf-struct, represented as \(32\times 17\times 32\times 17\) symmetric matrices of single-precision real floating point numbers for weight calculation, use 9.03 MiB of memory. The \(32\times 32\) and \(17\times 17\) matrices of stbf-struct only require 5.12 KiB.  
Second, structured estimation has better time complexity. Covariance estimation and inversion occupy the largest part of the STBF training time. For stbf-emp and stbf-shrunk, the time complexity of this process is \(\mathcal{O}(nc^{2}s^{2}+c^{3}s^{3})\). Thanks to Property 1, the complexity can be reduced to \(\mathcal{O}(nc^{2}s^{2}+c^{3}+s^{3})\) for the structured estimator of stbf-struct. The results presented in Figure 4 confirm these calculations. It can be observed that the training time of stbf-struct stays low compared to stbf-emp and stbf-shrunk when dimensionality increases.  
The results shown in Figure 4 also confirm that the STBF-based estimators are very fast to train compared to the state-of-the-art estimator xdawn+rg, which confirms the results in [21]. Since the training times of all STBF-based classifiers are already of the order of tenths of seconds, the question arises as to whether the improvements achieved using the structured estimator would be relevant in practice. However, the authors believe that these results could significantly impact some use-cases of the spatiotemporal beamformer, such as high-spatial- or temporal-resolution ERP analyses. One example is single-trial ERP analysis with a high temporal resolution to extract ERP time features. Such higher-resolution analyses can later be incorporated into an ERP classification framework. In addition, the speed provided by structured estimation yields a faster off-line evaluation of the STBF ERP classifier, in which multiple cross-validation folds, subjects, and hyperparameter settings often need to be explored, which can quickly increase runtime. Improvements in computation speed and memory usage can remove the need for dedicated computation hardware and enable group analyses to be run on a personal computer.