| acf.bspec {bspec} | R Documentation |
Deriving (posterior) autocovariances or autocorrelations from the spectrum's posterior distribution.
## S3 method for class 'bspec':
acf(x, spec = NULL,
type = c("covariance", "correlation"),
two.sided = x$two.sided, ...)
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. |
... |
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.
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. |
(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.
Christian Roever, bspec@web.de
Roever, C., Meyer, R., Christensen, N. (2008): Modelling coloured noise. Arxiv preprint 0804.3853 [stat.ME], http://arxiv.org/abs/0804.3853, (submitted for publication).
bspec,
expectation,
sample.bspec,
acf
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))