clo: Closes to a given total measure

View source: R/helpers.R

cloR Documentation

Closes to a given total measure

Description

This is a generic version of clo overwriting the one in compositions

Usage

clo(X, ..., close = TRUE)

## Default S3 method:
clo(X, ..., total = 1, close)

## S3 method for class ''function''
clo(X, measure = getReferenceMeasure(X), ..., total = 1, close)

## S3 method for class 'BDataDensities'
clo(X, ..., total = 1, close)

## S3 method for class 'BDataPDFs'
clo(X, ..., total = 1, close)

## S3 method for class 'BDataLogDensities'
clo(X, ..., total = 1, close)

## S3 method for class 'BDataLogPDFs'
clo(X, ..., total = 1, close)

## S3 method for class 'BayesSpaceBasis'
clo(X, ..., total = 1)

Arguments

X

the object to be closed

...

further arguments for generic use

close

a boolean, if FALSE the object is returned directly, if true unclosed objects will be closed.

total

the integral that is desired

measure

the reference measure for which the closing constant shall be computed. This is especially required for functions

Details

Closure rescales a (positive) function so that it integrates to 'total' (one by default) with respect to the reference measure, i.e. it projects the function to a proper density and thereby picks the representative of its Bayes-space class.

Value

and object of the same type as the incoming, but closed.

Methods (by class)

  • clo(default): the default is [compositions::clo]

  • clo(`function`): method for functions

  • clo(BDataDensities): method for BDataDensities

  • clo(BDataPDFs): method for BDataPDFs

  • clo(BDataLogDensities): method for BDataLogDensities

  • clo(BDataLogPDFs): method for BDataLogPDFs

  • clo(BayesSpaceBasis): method for BayesSpaceBasis returns the closed logDensities

See Also

[compositions::clo] for parameters of the default, [cen]

Examples

clo(function(x) x^2,measure=ReferenceMeasureUniform(0,1))


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