| BayesSpaceBasis | R Documentation |
Creates the finite-dimensional basis in which distributional data are represented for computation. Besides the functional spline basis and its [BayesSpace], the returned object stores the transformation matrix 'A' and the Gram matrix 'S' (the inner products of the basis elements).
BayesSpaceBasis(basis, ...)
## S3 method for class 'basisfd'
BayesSpaceBasis(
basis,
bayesSpace = BayesSpace(ReferenceMeasureUniform(basis$rangeval[1], basis$rangeval[2])),
A = computeL22BayesSpacesBasisMatrix(basis),
S = A %*% fda::inprod(basis, basis) %*% t(A)/diff(basis$rangeval),
orthonormalize = FALSE,
...
)
## S3 method for class 'fd'
BayesSpaceBasis(basis, ...)
## S3 method for class 'BayesSpace'
BayesSpaceBasis(basis, ...)
basis |
the object describing the basis (a function, an 'fda' basis, a reference measure, or a [BayesSpace]). |
... |
further generic arguments |
bayesSpace |
the BayesSpace this basis is designed for |
A |
the transformation matrix mapping the result of the function to the basis values |
S |
the Gram (metric) matrix of the given basis, 'S[i,j] = <psi_i, psi_j>'. For an orthonormal basis 'S' is the identity; for ZB-splines it is not. Used by all inner-product based operations. |
orthonormalize |
boolean if true creates an orthonormal basis, by a sigualr value decomposition based orthonormalization. |
The default basis (constructed from a reference measure or an 'fda' B-spline basis) consists of **zero-integral B-splines (ZB-splines)**: spline functions that integrate to zero, which is required to represent centred-log-ratio (clr) transformed densities. The object stores
a function evaluating the underlying (B-spline) basis,
the transformation matrix mapping those values to the ZB-spline basis, so the basis functions are 'zeta = A %*% B',
the Gram (metric) matrix 'S[i,j] = <zeta_i, zeta_j>',
the space and a centring flag.
ZB-splines are **not orthonormal**, so in general 'S' is not the identity; inner products, norms, variances and PCA all use 'S' (see [getMetricTensor], [princomp.BData]). Pass an explicit 'S' only if you have a better value than the internally computed one.
An object of class '"BayesSpaceBasis"': a list with components 'basis', 'bayesSpace', 'A', 'S' and 'centered'.
BayesSpaceBasis(basisfd): Construct from an basisfd object from functional data
BayesSpaceBasis(fd): Construct from an fd object from functional data
BayesSpaceBasis(BayesSpace): Calls BayesSpaceBasis on the Reference measure
[getMetricTensor], [BayesSpace], [as.BDataSplines], [princomp.BData]
[fda::basisfd]
[fda::fd]
basis <- BayesSpaceBasis(B2Unif01, nbasis = 7)
getMetricTensor(basis) # Gram matrix S (not the identity for ZB-splines)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.