CumulantsUpdates.DataMoments
— Typemutable struct DataMoments{T <: AbstractFloat}
structure that stores data (X), array of moments (M) and parameters: d - maximal moment order b - a size of a block
CumulantsUpdates.DataMoments
— MethodDataMoments(X, d, b)
a constructor, claculates an Array of moments given data and parameters
CumulantsUpdates.cnorms
— Methodcnorms(c::Vector{SymmetricTensor{T}})
Returns vector of Floats of norms of cumulants of order 3, ..., k , ..., m, normalsed by √||C₂||ᵏ .....
CumulantsUpdates.cums2moms
— Methodcums2moms(cum::Vector{SymmetricTensor})
Returns vector of Symmetric Tensors of moments given vector of Symmetric Tensors of cumulants
CumulantsUpdates.cumulantsupdate!
— Methodfunction cumulantsupdate!(dm::DataMoments{T}, Xplus::Matrix{T}) where T <: AbstractFloat
updates the DataMoments structure in a sliding window, given an updat Xplus and returns cumululants of updated data.
julia> x = ones(10,2);
julia> s = DataMoments(x, 4, 2);
julia> y = zeros(4,2);
julia> cumulantsupdate!(s,y)[4]
SymmetricTensors{Float64,4}(Union{Array{Float64,4}, Void}[[0.0064 0.0064; 0.0064 0.0064]
[0.0064 0.0064; 0.0064 0.0064]
[0.0064 0.0064; 0.0064 0.0064]
[0.0064 0.0064; 0.0064 0.0064]], 2, 1, 2, true)
CumulantsUpdates.dataupdat
— Methoddataupdat(X::Matrix{T}, Xplus::Matrix{T}) where T<:AbstractFloat
Returns Matrix{Float} of size(X), first u = size(Xup, 1) rows of X are removed and at the end the updat Xplus is appended.
julia> a = ones(4,4);
julia> b = zeros(2,4);
julia> dataupdat(a,b)
4×4 Array{Float64,2}:
1.0 1.0 1.0 1.0
1.0 1.0 1.0 1.0
0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0
CumulantsUpdates.loaddm
— Methodloaddm(str::String)
loads a DataMoment structure from a given direcory
CumulantsUpdates.momentarray
— Methodmomentarray(X::Matrix{Float}, m::Int, b::Int)
Returns an array of Symmetric Tensors of moments given data and maximum moment order - d
CumulantsUpdates.momentupdat
— Methodmomentupdat(M::Vector{SymmetricTensor{T}}, X::Matrix{T}, Xplus::Matrix{T})
Returns Vector{SymmetricTensor} of updated moments
CumulantsUpdates.momentupdat
— Methodmomentupdat(M::SymmetricTensor{Float, N}, X::Matrix, Xplus::Matrix)
Returns SymmetricTensor{Float, N} updated moment, given original moment, original data and update of data - dataup
julia> x = ones(6, 2);
julia> m = moment(x, 3);
julia> y = 2*ones(2,2);
julia> momentupdat(m, x, y)
SymmetricTensors.SymmetricTensor{Float64,3}(Union{Array{Float64,3}, Void}[[3.33333 3.33333; 3.33333 3.33333]
[3.33333 3.33333; 3.33333 3.33333]], 2, 1, 2, true)
CumulantsUpdates.moms2cums!
— Methodmoms2cums!(M::Vector{SymmetricTensor})
Changes vector of Symmetric Tensors of moments to vector of Symmetric Tensors of cumulants
julia> m = momentarray(ones(20,3), 3);
julia> moms2cums!(m)
julia> m[3]
SymmetricTensors.SymmetricTensor{Float64,3}(Union{Array{Float64,3}, Void}[[0.0 0.0; 0.0 0.0]
[0.0 0.0; 0.0 0.0] #undef; #undef #undef]
CumulantsUpdates.rep
— Methodrep(ind::Tuple)
axiliary for cnorm count how many times a block should be counted
julia> rep((1,2,3))
6
julia> rep((1,2,2))
3
julia> rep((1,1,1))
1
CumulantsUpdates.savedm
— Methodsavedm(dm::DataMoments, str::String)
saves a DataMoment structure at a given direcory
LinearAlgebra.norm
— Methodnorm(bt::SymmetricTensor{T, m}, p::Union{Float64, Int}=2) where {T<:AbstractFloat, m}
Returns Float, a p-norm of bt, supported for p ≠ 0
julia> te = [-0.112639 0.124715 0.124715 0.268717 0.124715 0.268717 0.268717 0.046154];
julia> st = convert(SymmetricTensor, (reshape(te, (2,2,2))));
julia> norm(st)
0.5273572868359742
julia> norm(st, 2.5)
0.4468668679541424
julia> norm(st, 1)
1.339089