# Diagonalizations.jl: a package for multivariate linear filtering

**URL:** <https://discourse.julialang.org/t/diagonalizations-jl-a-package-for-multivariate-linear-filtering/32990>\
**Category:** Package Announcements\
**Tags:** package, announcement, statistics, linearalgebra, time-series\
**Created:** [January 5, 2020, 11:52am UTC](https://discourse.julialang.org/t/diagonalizations-jl-a-package-for-multivariate-linear-filtering/32990 "2020-01-05T11:52:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marco-Congedo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marco-congedo/32/7321_2.png) [@Marco-Congedo](https://discourse.julialang.org/u/Marco-Congedo)\
**Post date:** [January 5, 2020, 11:52am UTC](https://discourse.julialang.org/t/diagonalizations-jl-a-package-for-multivariate-linear-filtering/32990/1 "2020-01-05T11:52:25Z")

</div>

I would like to announce [Diagonalizations.jl](https://github.com/Marco-Congedo/Diagonalizations.jl), a new package for multivariate statistics/signal processing. Currently it implements the following linear filters:

| Acronym | Full Name | Datasets ( _m_ ) | Observations ( _k_ ) |
| --- | --- | --- | --- |
| PCA | Principal Component Analysis | 1 | 1 |
| Whitening | Whitening (Sphering) | 1 | 1 |
| MCA | Maximum Covariance Analysis | 2 | 1 |
| CCA | Canonical Correlation Analysis | 2 | 1 |
| gMCA | generalized MCA | \>1 | 1 |
| gCCA | generalized CCA | \>1 | 1 |
| CSP | Common Spatial Pattern | 1 | 2 |
| CSTP | Common Spatio-Temporal Pattern | 1 | \>1 |
| AJD | Approximate Joint Diagonalization | 1 | \>1 |
| mAJD | multiple AJD | \>1 | \>1 |

It is thoroughly tested (for real data input for the moment being) and [documented](https://marco-congedo.github.io/Diagonalizations.jl/dev/).

As compared to [MultivariateStats.jl](https://github.com/JuliaStats/MultivariateStats.jl) this package supports :

- the `dims` keyword,
- built-in shrinkage covariance matrix estimations throught the [CovarianceEstimation](https://github.com/mateuszbaran/CovarianceEstimation.jl) package,
- built-in average covariance estimations with metrics for the manifold of positive definite matrices throught the [PosDefManifold](https://github.com/Marco-Congedo/PosDefManifold.jl) package,
- automatic procedures to set the subspace dimension upon construction,
- approximate diagonalization procedures for the case `m≥2` and `k≥2` (see table above).

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [January 5, 2020, 12:58pm UTC](https://discourse.julialang.org/t/diagonalizations-jl-a-package-for-multivariate-linear-filtering/32990/2 "2020-01-05T12:58:36Z")

</div>

Also worth mentioning other existing efforts in the ecosystem like [LowRankModels.jl](https://github.com/madeleineudell/LowRankModels.jl), which generalizes some of these methods to work with other types of data like categorical data.

Quick question: did you contact the people in MultivariateStats.jl to discuss the possibility of adding the features you described above?

---

<div class="post-metadata">

**Author:** ![Zach\_Christensen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zach_christensen/32/7220_2.png) [@Zach\_Christensen](https://discourse.julialang.org/u/Zach_Christensen)\
**Post date:** [January 5, 2020, 1:03pm UTC](https://discourse.julialang.org/t/diagonalizations-jl-a-package-for-multivariate-linear-filtering/32990/3 "2020-01-05T13:03:12Z")

</div>

I absolutely love what I’m seeing here and second @juliohm. Last I checked MultivariateStats.jl was working towards restructuring its type system and it would probably be beneficial for everyone if they (we) got perspectives from people with multiple use cases.

---

<div class="post-metadata">

**Author:** ![Marco-Congedo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marco-congedo/32/7321_2.png) [@Marco-Congedo](https://discourse.julialang.org/u/Marco-Congedo)\
**Post date:** [January 5, 2020, 2:18pm UTC](https://discourse.julialang.org/t/diagonalizations-jl-a-package-for-multivariate-linear-filtering/32990/4 "2020-01-05T14:18:37Z")

</div>

Hello @juliohm,

no, I didn’t. I arrived to Julia less then one year ago and i learnt about _MultivariateStats.jl_ pretty late. In any case, the scope of _Diagonalizations.jl_ is much more restricted as compared to the scope of _MultivariateStats.jl_. As per the overlapping with _MultivariateStats.jl_, it is limited to the PCA, Whitening and CCA, which are basic procedures. From there, the path of the two packages diverges. For the future, I guess the iterative solvers implemented in _Diagonalizations.jl_ (more of them could be added later on) may be useful in _MultivariateStats.jl_, for example, to add more independent component analysis and blind source separation methods. I am actually interested in this if there is any plan.

---

<div class="post-metadata">

**Author:** ![Marco-Congedo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marco-congedo/32/7321_2.png) [@Marco-Congedo](https://discourse.julialang.org/u/Marco-Congedo)\
**Post date:** [January 10, 2020, 5:37pm UTC](https://discourse.julialang.org/t/diagonalizations-jl-a-package-for-multivariate-linear-filtering/32990/5 "2020-01-10T17:37:07Z")

</div>

just a note to correct what i said here above, since i added support for complex data input.
