acf.bspec {bspec} | R Documentation |

## Posterior autocovariances

### Description

Deriving (posterior) autocovariances or autocorrelations from the spectrum's posterior distribution.

### Usage

```
## S3 method for class 'bspec'
acf(x, spec = NULL,
type = c("covariance", "correlation"),
two.sided = x$two.sided, ...)
```

### Arguments

`x` |
a |

`spec` |
(optional) a |

`type` |
a |

`two.sided` |
a |

`...` |
currently unused. |

### Details

If `spec`

is supplied, the autocovariance (or autocorrelation)
function corresponding to that specific spectrum will be returned.
As this is a completely deterministic relationship, the
“`stderr`

” slot of the result will be zero in this case.

If `spec`

is *not* supplied, the *(posterior) expected
autocovariance* is returned in the “`acf`

” element, and its
*(posterior) standard deviation* is returned in the
“`stderr`

” element.
The posterior expectation of the autocovariance is only finite if
*all (!)* posterior degrees-of-freedom parameters in the
`bspec`

object are `>2`

. The posterior
variance (and with that the `stderr`

element) is only finite if all
these are `>4`

.

Autocorrelations are only returned if `spec`

is supplied.

### Value

A list of class `bspecACF`

containing the following components:

`lag` |
a |

`acf` |
a |

`stderr` |
a |

`type` |
a |

`N` |
an |

`bspec` |
a |

### Note

(Posterior) expectation and standard deviation of the spectrum may in
many cases not be finite (see above).
Autocorrelations are only returned if `spec`

is supplied.

### 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.
doi: 10.1088/0264-9381/28/1/015010.
See also arXiv preprint 0804.3853.

### See Also

`bspec`

,
`expectation`

,
`sample.bspec`

,
`acf`

### Examples

```
lhspec1 <- bspec(lh)
# without any prior specifications,
# autocovariances are not finite:
print(acf(lhspec1))
str(acf(lhspec1))
# for given values of the spectral parameters,
# the autocovariances are fixed:
str(acf(lhspec1, spec=sample(lhspec1)))
# for all the prior degrees-of-freedom greater than one,
# the expected autocovariance is finite, its variance isn't:
lhspec2 <- bspec(lh, priordf=2, priorscale=0.6, intercept=FALSE)
print(acf(lhspec2))
str(acf(lhspec2))
plot(acf(lhspec2))
```

*bspec*version 1.6 Index]