Reference
PrincipalMomentAnalysis.pma — Functionpma(A, G::SimplexGraph; nsv=6)Computes the Principal Moment Analysis of the matrix A (variables × samples) using the sample SimplexGraph G. Each column in G is a boolean vector representing one simplex. True means that a vertex is part of the simplex and false that it is not. Set nsv to control the number of singular values and vectors returned. Returns a PMA struct.
See also PMA, SimplexGraph.
pma(A, G::AbstractMatrix{Bool}; nsv=6)Computes the Principal Moment Analysis of the matrix A (variables × samples). Each column in G is a boolean vector representing one simplex. True means that a vertex is part of the simplex and false that it is not. Set nsv to control the number of singular values and vectors returned. Returns a PMA struct.
See also PMA, SimplexGraph.
PrincipalMomentAnalysis.PMA — TypePMA <: FactorizationThe output of pma representing the Principal Moment Analysis factorization of a matrix A. If F::PMA is the factorization object, U, S, V and Vt can be obtained via F.U, F.S, F.V and F.Vt such as A ≈ U * Diagonal(S) * Vt'.
See also pma.
PrincipalMomentAnalysis.normalizemean! — Functionnormalizemean!(A)In place removal of the variable mean from the P×N matrix A where P is the number of variables and N is the number of samples.
PrincipalMomentAnalysis.normalizemean — Functionnormalizemean(A)Remove the variable mean from the P×N matrix A where P is the number of variables and N is the number of samples.
PrincipalMomentAnalysis.normalizemeanstd! — Functionnormalizemeanstd!(A)In place normalization of variables to be mean zero and standard deviation one of the P×N matrix A where P is the number of variables and N is the number of samples.
PrincipalMomentAnalysis.normalizemeanstd — Functionnormalizemeanstd!(A)Normalize variables to be mean zero and standard deviation one in the P×N matrix A where P is the number of variables and N is the number of samples.
PrincipalMomentAnalysis.SimplexGraph — TypeSimplexGraph{T<:AbstractMatrix{Bool}, S<:Union{Number,AbstractVector{<:Number}}}Struct describing a set of simplices with vertices numbered from 1:N. Optionally, each simplex can be assigned a weight.
Usage
SimplexGraph(G, w=true)Construct a SimplexGraph. G is a MxN matrix of booleans, where M is the number of vertices and N is the number of simplices. Each column in G represents one simplex. True means that a vertex is part of the simplex and false that it is not. Optionally, a vector w of length N can be used to specify a weight (total mass) for each simplex. The weight defaults to 1 (true).
See also pma, groupsimplices, timeseriessimplices, neighborsimplices.
PrincipalMomentAnalysis.groupsimplices — Functiongroupsimplices(groupby::AbstractVector)Create SimplexGraph connecting elements with identical values in the groupby vector.
Examples
julia> sg = groupsimplices(["A","A","B","C","B"]);
julia> sg.G
5×3 BitArray{2}:
1 0 0
1 0 0
0 1 0
0 0 1
0 1 0
julia> sg.w
3-element Array{Int64,1}:
2
2
1PrincipalMomentAnalysis.timeseriessimplices — Functiontimeseriessimplices(time::AbstractVector; groupby::AbstractVector)Create SimplexGraph connecting elements adjacent in time. In case of ties, all elements at a unique timepoint will be connected to the all elements at the previous, current and next timepoints. If groupby is specified, the elements are first divided by group, and then connected by time.
Examples
julia> sg = timeseriessimplices([0.5, 1.0, 4.0]);
julia> sg.G
3×3 BitArray{2}:
1 1 0
1 1 1
0 1 1
julia> sg = timeseriessimplices([0.5, 1.0, 1.0, 4.0]);
julia> sg.G
4×3 BitArray{2}:
1 1 0
1 1 1
1 1 1
0 1 1
julia> sg.w
3-element Array{Int64,1}:
1
2
1
julia> sg = timeseriessimplices([2, 4, 6, 2, 4, 8]; groupby=["A","A","A","B","B","B"]);
julia> sg.G
6×6 BitArray{2}:
1 1 0 0 0 0
1 1 1 0 0 0
0 1 1 0 0 0
0 0 0 1 1 0
0 0 0 1 1 1
0 0 0 0 1 1PrincipalMomentAnalysis.neighborsimplices — Functionneighborsimplices(A::AbstractMatrix; k, r, dim, symmetric, normalizedist, groupby)Create simplex graph connecting nearest neighbor samples.
Inputs
A: Data matrix (variables × samples).k: Number of nearest neighbors to connect. Default:0.r: Connected all neighbors with disctance≤r. Default:0.0.dim: Reduce the dimension todimbefore computing distances. Useful to reduce noise. Default: Disabled.symmetric: Make the simplex graph symmetric. Default:false.normalizedist: Normalize distances to the scale [0.0,1.0] such that the maximal distance from a point to the origin is 0.5. Affects therparameter. Default:true.groupby: Only connected samples within the specified groups. Default: Disabled.
Examples
julia> sg = neighborsimplices([0 0 2 2; 0 1 1 0]; k=1); sg.G
4×4 BitArray{2}:
1 1 0 0
1 1 0 0
0 0 1 1
0 0 1 1
julia> sg = neighborsimplices([0 0 2 2; 0 1 1 0]; r=0.45); sg.G
4×4 BitArray{2}:
1 1 0 1
1 1 1 0
0 1 1 1
1 0 1 1Missing docstring for neighborsimplices2. Check Documenter's build log for details.