scalarProductOfLogDensities: Computes the scalar product of log densities in a BayesSpace

View source: R/helpers.R

scalarProductOfLogDensitiesR Documentation

Computes the scalar product of log densities in a BayesSpace

Description

This uses the Covariance Operator capability of the ReferenceMeasure, x and y are converted to functions.

Usage

scalarProductOfLogDensities(x, y = x, space)

Arguments

x

a log density function (centering is not required)

y

a log density function (centering is not required)

space

a BayesSpace (or anything that has a ReferenceMeasure)

Value

the scalar product of the (centred) log-densities 'x' and 'y' with respect to the reference measure of 'space', computed via the covariance operator of that measure. A single numeric value for scalar functions, or a matrix of pairwise scalar products when 'x' and 'y' are vector-valued (e.g. basis functions).

Examples

scalarProductOfLogDensities(function(x) rep(1,length(x)),space=B2Unif01)


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