Learn R Programming

bspec (version 1.6)

acf.bspec: Posterior autocovariances

Description

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

Usage

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

Arguments

x

a bspec object.

spec

(optional) a numeric vector giving fixed values of the spectral parameters (e.g. derived by the sample function) for which the autocovariances then are deterministic.

type

a character string specifying the desired type of output.

two.sided

a logical flag indicating whether the spec values are to be interpreted as one-sided or two-sided.

...

currently unused.

Value

A list of class bspecACF containing the following components:

lag

a numeric vector giving the lags corresponding to the (discrete) autocovariance / autocorrelation values.

acf

a numeric vector giving the values of the autocovariance / autocorrelation function correponding to the above lags.

stderr

a numeric vector giving the standard errors (posterior standard deviations) of the above autocovariance values.

type

a character string giving the nature of the above acf element: either "covariance" or "correlation".

N

an integer giving the sample size of the original time series.

bspec

a character string giving the name of the bspec object the bspecACF object was generated from.

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.

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, expectation, sample.bspec, acf

Examples

Run this code
# NOT RUN {
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))
# }

Run the code above in your browser using DataLab