| expectation.ReferenceMeasureUniform | R Documentation |
integrate a function over the uniform reference measure
## S3 method for class 'ReferenceMeasureUniform'
expectation(measure, f, ..., method = c("sample", "integrate"))
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. |
the integral of f over c(x[1],x[2])
RMU <- ReferenceMeasureUniform(a=-5,b=5)
expectationRMU <- expectation(measure=RMU,f=cos,method="integrate")
expectationRMU
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.