CoDa.Composition
— TypeComposition(symsparts)
Composition(syms, parts)
Composition(sym₁=val₁, sym₂=val₂, ...)
Composition(parts)
Composition(val₁, val₂, ...)
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 part-1
, part-2
, ..., part-D
:
julia> Composition(0.1, 0.8)
julia> Composition((0.1, 0.8))
Base.getproperty
— Methodgetproperty(c, name)
Return the value of part with given name
in the composition c
.
Base.names
— Methodnames(c)
Names of parts in the composition c
.
CoDa.alr
— Methodalr(c)
Additive log-ratio transformation of composition c
.
CoDa.alrinv
— Methodalrinv(x)
Inverse alr for coordinates x
.
CoDa.clr
— Methodclr(c)
Centered log-ratio transformation of composition c
.
CoDa.clrinv
— Methodclrinv(x)
Inverse clr for coordinates x
.
CoDa.compose
— Methodcompose(table, (:c1, c2, ..., :cn) [=> :coda])
Convert columns :c1
, :c2
, ..., :cn
of table
into parts of a composition and save it as a new column with name :coda
.
Example
# create a new table with `:coda` column
compose(table, (:Cd, :Cu, :Pb))
# create a new table with `:comp` column
compose(table, (:Cd, :Cu, :Pb) => :comp)
CoDa.distance
— Methoddistance(c₁, c₂)
Aitchison distance between compositions c₁
and c₂
.
CoDa.ilr
— Methodilr(c)
Isometric log-ratio transformation of composition c
.
CoDa.ilrinv
— Methodilrinv(x)
Inverse ilr for coordinates x
.
CoDa.readcoda
— Methodreadcoda(args...; codanames=nothing, kwargs...)
Read data from disk using CSV.read
, optionally specifying the columns codanames
with the parts of the composition. If nothing
is specified, interpret all columns as parts.
The arguments args
and keyword arguments kwargs
are forwarded to the CSV.read
function, please check their documentation for more details.
The option codanames
can also be a pair as described in the documentation of compose
.
CoDa.𝓒
— Method𝓒(x)
Return closure of x
.
LinearAlgebra.dot
— Methoddot(c₁, c₂)
Inner product between compositions c₁
and c₂
.
LinearAlgebra.norm
— Methodnorm(c)
Aitchison norm of composition c
.