fcenLRinv: Inverse of the functional clr transformations

View source: R/Transformations.R

fcenLRinvR Documentation

Inverse of the functional clr transformations

Description

Maps a clr-transformed function back to a density,

f(z) = k\,\frac{\exp(g(z))}{\int \exp(g(t))\,dt},

where g is the output of fcenLR, fcenLRp or fcenLRu. Because densities in the Bayes space are scale invariant, the result is only defined up to a constant; k fixes it so that the returned density integrates to k.

Usage

fcenLRinv(z, z_step, fcenLR, k = 1)

Arguments

z

numeric vector, the grid on which fcenLR is evaluated. It is currently not used in the computation and kept for consistency with the other functions of the family.

z_step

spacing of the (equidistant) grid.

fcenLR

numeric vector, a clr-transformed density on the grid, as returned by fcenLR, fcenLRp or fcenLRu.

k

positive number, the value the returned density should integrate to; the default k = 1 gives a probability density.

Details

The integral is approximated by trapzc with spacing z_step. Depending on the input, the result is (i) the \lambda-density in B^2(\lambda) for fcenLR output, (ii) the P-density in B^2(P) for fcenLRp output, or (iii) the representation of the P-density in the unweighted space B^2(\lambda) for fcenLRu output.

Value

A numeric vector of the same length as fcenLR: the density evaluated on the grid, integrating to k.

Author(s)

R. Talska talskarenata@seznam.cz, A. Menafoglio, K. Hron karel.hron@upol.cz, J. J. Egozcue, J. Palarea-Albaladejo

References

Talska, R., Menafoglio, A., Hron, K., Egozcue, J. J., Palarea-Albaladejo, J. (2020). Weighting the domain of probability densities in functional data analysis. Stat. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1002/sta4.283")}

See Also

fcenLR, fcenLRp, fcenLRu, trapzc, cenLRinv

Examples

t <- seq(-4.7, 4.7, length = 1000)
t_step <- diff(t[1:2])
f <- dnorm(t, mean = 0, sd = 1.5)

f.fcenLR <- fcenLR(t, t_step, f)

# back to a unit-integral density ...
f.back <- fcenLRinv(t, t_step, f.fcenLR)
trapzc(t_step, f.back)

# ... or to a density integrating to 100
trapzc(t_step, fcenLRinv(t, t_step, f.fcenLR, k = 100))

plot(t, f.back, type = "l", las = 1, ylab = "density",
  col = "darkblue", lwd = 2)

robCompositions documentation built on Nov. 1, 2026, 1:06 a.m.