MinimumVarianceAnalysis
A Julia package for minimum or maximum variance analysis (MVA).
API Reference
MinimumVarianceAnalysis.B_x3_error
— MethodCalculate the composite statistical error estimate for ⟨B·x₃⟩: |Δ⟨B·x₃⟩| = √(λ₃/(M-1) + (Δφ₃₂⟨B⟩·x₂)² + (Δφ₃₁⟨B⟩·x₁)²)
Parameters:
- λ₁, λ₂, λ₃: eigenvalues in descending order
- M: number of samples
- B: mean magnetic field vector
- x₁, x₂, x₃: eigenvectors
MinimumVarianceAnalysis.check_mva_eigen
— Methodcheck_mva_eigen(F; r=5, verbose=false)
Check the quality of the MVA result.
If λ₁ ≥ λ₂ ≥ λ₃ are 3 eigenvalues of the constructed matrix M, then a good indicator of nice fitting LMN coordinate system should have $abs(λ₂ / λ₃) > r$.
MinimumVarianceAnalysis.mva
— Functionmva(V, B=V; dim=nothing, kwargs...)
Transform a timeseries V
into the LMN coordinate system based on the minimum variance analysis of reference field B
along the dim
dimension (time).
MinimumVarianceAnalysis.mva_eigen
— Methodmva_eigen(B::AbstractMatrix; dim = nothing, sort=(;), check=false) -> F::Eigen
Perform minimum variance analysis for B
(which varies along the dim
dimension).
Return Eigen
factorization object F
which contains the eigenvalues in F.values
and the eigenvectors in the columns of the matrix F.vectors
.
Set check=true
to check the reliability of the result.
The k
th eigenvector can be obtained from the slice F.vectors[:, k]
.
MinimumVarianceAnalysis.transform
— Methodtransform(A, mat::AbstractMatrix; dim=nothing, query=nothing)
Transform A
into a new coordinate system using transformation matrix mat
along the dim
dimension (time).
MinimumVarianceAnalysis.Δφij
— MethodΔφij(λᵢ, λⱼ, λ₃, M)
Calculate the phase error between components i and j according to: |Δφᵢⱼ| = |Δφⱼᵢ| = √(λ₃/(M-1) * (λᵢ + λⱼ - λ₃)/(λᵢ - λⱼ)²)
Parameters:
- λᵢ: eigenvalue i
- λⱼ: eigenvalue j
- λ₃: smallest eigenvalue (λ₃)
- M: number of samples