Learn R Programming

bspec (version 1.6)

expectation: Expectations and variances of distributions

Description

Functions to compute (posterior) expectations or variances of the distributions specified as arguments.

Usage

expectation(x, ...)
  variance(x, ...)
  # S3 method for bspec
expectation(x, two.sided=x$two.sided, ...)
  # S3 method for bspec
variance(x, two.sided=x$two.sided, ...)
  # S3 method for bspecACF
expectation(x, ...)
  # S3 method for bspecACF
variance(x, ...)

Arguments

x

A bspec or bspecACF object.

two.sided

A logical flag to indicate whether to compute expectation / variance of one- or two-sided spectrum, if the argument x is a bspec object.

...

currently unused.

Value

A numeric vector giving the expectations/variances corresponding to the frequencies or lags of the argument.

References

Roever, C., Meyer, R., Christensen, N. Modelling coloured residual noise in gravitational-wave signal processing. Classical and Quantum Gravity, 28(1):015010, 2011. 10.1088/0264-9381/28/1/015010. See also arXiv preprint 0804.3853.

See Also

bspec, acf.bspec

Examples

Run this code
# NOT RUN {
# note the changing expectation
# with increasing prior/posterior degrees-of-freedom:
expectation(bspec(lh))
expectation(bspec(lh, priordf=1, priorscale=0.6))
expectation(bspec(lh, priordf=2, priorscale=0.6))

# similar for variance:
variance(bspec(lh, priordf=2, priorscale=0.6))
variance(bspec(lh, priordf=3, priorscale=0.6))

# and again similar for autocovariances:
expectation(acf(bspec(lh)))
expectation(acf(bspec(lh, priordf=2, priorscale=0.6)))
variance(acf(bspec(lh)))
variance(acf(bspec(lh, priordf=4, priorscale=0.6)))
# }

Run the code above in your browser using DataLab