BayesSpaceBasis.function: Creates a BayesSpaceBasis from a function

View source: R/classes.R

BayesSpaceBasis.functionR Documentation

Creates a BayesSpaceBasis from a function

Description

The function needs a vectorized function mapping the support of the Bayes space to real densities.

Usage

## S3 method for class ''function''
BayesSpaceBasis(
  basis,
  bayesSpace = B2Unif01,
  A = diag(rep(1, ncol(basis(getSample(bayesSpace))))),
  S = A %*% scalarProductOfLogDensities(basis, space = bayesSpace) %*% t(A),
  orthonormalize = FALSE,
  ...,
  centered = FALSE
)

Arguments

basis

the function representing the log densities representing the basis.

bayesSpace

the BayesSpace the basis is defined for

A

the matrix mapping the results of f to the log densities.

S

the Gram (metric) matrix of this basis, 'S[i,j] = <psi_i, psi_j>' (see [getMetricTensor]). Stored as the Gram matrix itself, not its inverse.

orthonormalize

boolean: if TRUE the basis is orthogonalized, using a singluar using a singular value decomposition based matrix square root.

...

further unused generic arguments

centered

a boolean, if true the basis is considered centered

Details

A and S only need to be provided if there is a better result availabel than from the internal computation of the Bayes space

Value

A BayesSpaceBasis

See Also

BayesSpaceBasis

Examples

BayesSpaceBasis(function(x) outer(x,1:5,function(a,b) cos(a*b*pi)))
BayesSpaceBasis(function(x) outer(x,1:5,function(a,b) cos(a*b*pi)),orthonormalize=TRUE)

DistributionalDDA documentation built on Oct. 20, 2026, 5:06 p.m.