expectation {bspec} R Documentation

## 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 class 'bspec'
expectation(x, two.sided=x\$two.sided, ...)
## S3 method for class 'bspec'
variance(x, two.sided=x\$two.sided, ...)
## S3 method for class 'bspecACF'
expectation(x, ...)
## S3 method for class '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.

### Author(s)

Christian Roever, christian.roever@med.uni-goettingen.de

### References

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

`bspec`, `acf.bspec`

### Examples

```# 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)))
```

[Package bspec version 1.5 Index]