expectation.ReferenceMeasureUniform: integrate a function over the uniform reference measure

View source: R/Bayes_spaces.R

expectation.ReferenceMeasureUniformR Documentation

integrate a function over the uniform reference measure

Description

integrate a function over the uniform reference measure

Usage

## S3 method for class 'ReferenceMeasureUniform'
expectation(measure, f, ..., method = c("sample", "integrate"))

Arguments

measure

the ReferenceMeasureUniform object

f

function to be integrated

...

further arguments to [stats::integrate()]

method

a method for computing the expectation given as a string. The default argument shows possible choices. Default chooses the default for reference measure (typically "sample"), "sample" uses the reference sample of the measure, "MonteCarlo" uses iterative random simulation until a certain tolerance is reached, "integrate" is only possible in a few measures and tries a numerical integration.

Value

the integral of f over c(x[1],x[2])

Examples

RMU <- ReferenceMeasureUniform(a=-5,b=5)
expectationRMU <- expectation(measure=RMU,f=cos,method="integrate")
expectationRMU

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