CoDa.F
— ConstantF
F(d)
User interface for FMatrix
, as defined by Aitchison.
F
is a d
by D
matrix that can be defined as
F[i, j] = 1
, if i==j
F[i, j] = -1
, if j==D
F[i, j] = 0
, otherwise
Examples
julia> F(3)
julia> F*v
julia> v'*F
CoDa.G
— ConstantG
G(D)
User interface for GMatrix
, as defined by Aitchison.
G
is an D
by D
matrix that can be defined as
G[i, j] = I[i, j] - J[i, j] / D
Examples
julia> G(3)
julia> G*v
julia> v'*G
CoDa.H
— ConstantH
H(d)
User interface for HMatrix
, as defined by Aitchison.
H
is a d
by d
matrix that can be defined as
H[i, j] = I[i, j] + J[i, j]
Examples
julia> H(3)
julia> H*v
julia> v'*H
CoDa.J
— ConstantJ
J(d)
User interface for JMatrix
, a d
by d
matrix of ones.
Examples
julia> J(3)
julia> J*v
julia> v'*J
CoDa.Aitchison
— TypeAitchison()
Aitchison distance following the Distances.jl API.
CoDa.CoDaArray
— TypeCoDaArray(table)
Construct an array of compositional data from table
.
CoDa.Composition
— TypeComposition(partscomps)
Composition(parts, comps)
Composition(part₁=comp₁, part₂=part₂, ...)
Composition(comps)
Composition(comp₁, comp₂, ...)
A D-part composition as defined by Aitchison 1986.
Examples
A 2-part composition with parts a=0.1
and b=0.8
:
julia> Composition(a=0.2, b=0.8)
julia> Composition((a=0.2, b=0.8))
julia> Composition((:a, :b), (0.2, 0.8))
When the names of the parts are not specified, the constructor uses default names w1
, w2
, ..., wD
:
julia> Composition(0.1, 0.8)
julia> Composition((0.1, 0.8))
CoDa.FMatrix
— TypeFMatrix{T}
F
matrix, as defined by Aitchison 1986. See also F
.
CoDa.F′Matrix
— TypeF′Matrix{T}
Lazy adjoint of FMatrix{T}
.
CoDa.GMatrix
— TypeGMatrix{T}
G
matrix, as defined by Aitchison 1986. See also G
.
CoDa.HMatrix
— TypeHMatrix{T}
H
matrix, as defined by Aitchison 1986. See also H
.
CoDa.H⁻¹Matrix
— TypeH⁻¹Matrix{T}
Lazy inverse of HMatrix{T}
.
CoDa.JMatrix
— TypeJMatrix{T}
Square matrix of ones. See also J
.
Base.rand
— Methodrand(Composition{D}, n=1)
Generates D
-part composition at random according to a balanced Dirichlet distribution.
CoDa.aitchison
— Methodaitchison(c₁, c₂)
Return the Aitchison distance between compositions c₁
and c₂
.
CoDa.alr
— Methodalr(c)
Additive log-ratio transformation of composition c
.
CoDa.alrcov
— Methodalrcov(table)
Return the log-ratio covariance matrix Σ
of the table
such that:
Σ[i,j] = cov(log(x[i]/x[D]), log(x[j]/x[D]))
fori, j = 1, ..., d
CoDa.alrinv
— Methodalrinv(x)
Inverse alr transformation of coordinates x
.
CoDa.clr
— Methodclr(c)
Centered log-ratio transformation of composition c
.
CoDa.clrcov
— Methodclrcov(table)
Return the centered log-ratio covariance matrix Γ
of the table
such that:
Γ[i,j] = cov(log(x[i]/g(x)), log(x[j]/g(x)))
fori, j = 1, ..., D
,
where g(x)
is the geometric mean.
CoDa.clrinv
— Methodclrinv(x)
Inverse clr transformation of coordinates x
.
CoDa.components
— Methodcomponents(c)
Components in the composition c
.
CoDa.compose
— Functioncompose(table, colnames; keepcols=true, as=:CODA)
Convert columns colnames
of table
into parts of a composition and save the result in a CoDaArray
. If keepcols
is set to true
, then save the result as
a column in a new table with all other columns preserved.
CoDa.ilr
— Methodilr(c)
Isometric log-ratio transformation of composition c
.
CoDa.ilrinv
— Methodilrinv(x)
Inverse ilr transformation of coordinates x
.
CoDa.lrarray
— Methodlrarray(table)
Return the variation array A
of the table
such that:
A[i,j] = E[log(x[i]/x[j])]
fori > j
A[i,j] = Var(log(x[i]/x[j]))
fori < j
A[i,j] = 0
fori = j
CoDa.parts
— Methodparts(c)
Parts in the composition c
.
CoDa.parts
— Methodparts(array)
Parts in compositional array
.
CoDa.smooth
— Methodsmooth(c, τ)
Add small value τ
to all components of composition c
in order to remove essential zeros.
CoDa.variation
— Methodvariation(table)
Return the variation matrix Τ
of the table
such that:
Τ[i,j] = Var(log(x[i]/x[j]))
fori, j = 1, ..., D
CoDa.𝒞
— Method𝒞(x)
Return closure of x
.