Description Usage Arguments Details Value References Examples
View source: R/normaliseDensities.R
Preprocessing function to ensure densities integrate to 1
1 | normaliseDensities(dmatrix, dSup = 1:ncol(dmatrix))
|
dmatrix |
Matrix with rows representing distinct densities on dSup - all entries must be nonnegative |
dSup |
Support (grid) for Density domain |
Uses trapezoidal integration to normalise the densities to have integral 1
matrix 'dmatrix' consisting of rows of input of the same name that have been normalised to have integral 1
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 | ## Normalise collection of truncated normal densities
mu <- seq(-2, 2, by = 0.5)
dSup = seq(-3, 3, length.out = 101)
y <- t(sapply(mu, function(m) dnorm(x = dSup, mean = m)))
# Should return warnings about densities not integrating to 1
lqd = MakeLQDsample(dmatrix = y, dSup = dSup)
# Normalise and rerun without warning
dens <- normaliseDensities(dmatrix = y, dSup = dSup)
lqd = MakeLQDsample(dmatrix = dens, dSup = dSup)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.