Deriving (posterior) autocovariances or autocorrelations from the spectrum's posterior distribution.
# S3 method for bspec
acf(x, spec = NULL,
type = c("covariance", "correlation"),
two.sided = x$two.sided, ...)
a bspec
object.
(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.
a character
string specifying the desired type of
output.
a logical
flag indicating whether the
spec
values are to be interpreted as one-sided or
two-sided.
currently unused.
A list of class bspecACF
containing the following components:
a numeric
vector giving the lags
corresponding to the (discrete) autocovariance / autocorrelation
values.
a numeric
vector giving the values of the
autocovariance / autocorrelation function correponding to the
above lags.
a numeric
vector giving the standard
errors (posterior standard deviations) of the above autocovariance
values.
a character
string giving the
nature of the above acf
element: either "covariance"
or "correlation"
.
an integer
giving the sample
size of the original time series.
a character
string giving the
name of the bspec
object the bspecACF
object was
generated from.
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 stderr
element) is only finite if all
these are
Autocorrelations are only returned if spec
is supplied.
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.
# 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