Description Usage Arguments Value References See Also Examples
View source: R/MakeLQDsample.R
See 'dens2lqd' and 'RegulariseByAlpha' for more details. This function first (transforms the densities in 'dmatrix' to log quantile density functions, optionally followed by regularisation.
1 2 3 4 5 6 7 | MakeLQDsample(
dmatrix,
dSup,
lqdSup = seq(0, 1, length.out = length(dSup)),
useAlpha = FALSE,
alpha = 0.01
)
|
dmatrix |
Matrix holding the density values on dSup - all rows must be strictly positive and integrate to 1 |
dSup |
Support (grid) for Density domain |
lqdSup |
Support grid for lqd domain (default = seq(0, 1, length.out = length(dSup))) |
useAlpha |
should regularisation be performed (default=FALSE) |
alpha |
Scalar to regularise the supports with (default=0.01) |
list with 'LQD', a matrix of log quantile density functions, and 'lqdSup' that matches the input argument
Functional Data Analysis for Density Functions by Transformation to a Hilbert space, Alexander Petersen and Hans-Georg Mueller, 2016
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
x <- seq(0,1,length.out = 101)
# some log quantile densities on (0, 1)
y <- t(sapply(seq(0.5, 1.5, length.out = 10), function(b) -log(b^2 + 4*(1-b)*x)/2))
# Get densities
y.dens = MakeDENsample(qmatrix = y, lqdSup = x, dSup = x)$DEN
matplot(x, t(y.dens), ylab = 'Density', type = 'l', lty = 1, col = 'black')
# Get LQDs Back
y.lqd = MakeLQDsample(y.dens, lqdSup = x, dSup = x)
# These should match
matplot(y.lqd$lqdSup, t(y.lqd$LQD), ylab = 'LQD', type = 'l', lty = 1, col = 'blue')
matplot(x, t(y), ylab = 'LQD', type = 'l', lty = 1, col = 'red')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.