scalarProduct: Computes the scalar product of (datasets of) vectors from...

View source: R/operations.R

scalarProductR Documentation

Computes the scalar product of (datasets of) vectors from various spaces

Description

The scalar product might depend on the space in which the operation takes place.

Usage

scalarProduct(x, y, space = NULL, ...)

## S3 method for class 'numeric'
scalarProduct(x, y = x, space, ...)

## S3 method for class 'BDataSplines'
scalarProduct(x, y, space = getBayesSpace(x), ...)

## S3 method for class 'BDataDensities'
scalarProduct(x, y = x, space = getBayesSpace(x), ...)

## S3 method for class 'BDataLogDensities'
scalarProduct(x, y = x, space = getBayesSpace(x), ...)

Arguments

x

an element of the space (or a dataset of such elements)

y

an element of the space (or a dataset of such elements)

space

the space in which the scalar product shall be computed

...

further generic arguments, like e.g. method for the compution

Value

A numeric scalar, vector, or matrix of inner products, depending on the inputs.

Methods (by class)

  • scalarProduct(numeric): of vectors (or rows of a matrix) potentially over the metric tensor of the space.

  • scalarProduct(BDataSplines): in BayesSpaces for BDataSplines objects

  • scalarProduct(BDataDensities): in BayesSpaces for BDataDensities objects

  • scalarProduct(BDataLogDensities): in BayesSpaces for BDataLogDensities objects

Examples

X <- BDataSplines(matrix(c(1,2,3,4,5, 2,1,0,1,2), nrow=2, byrow=TRUE),
                  B2Unif01Basis5)
scalarProduct(X, X)

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