Learn R Programming

bspec (version 1.6)

quantile.bspec: Quantiles of the posterior spectrum

Description

Function to compute quantiles of the spectrum's posterior distribution specified through the supplied bspec object argument.

Usage

# S3 method for bspec
quantile(x, probs = c(0.025, 0.5, 0.975),
  two.sided = x$two.sided, ...)

Arguments

x

a bspec object.

probs

a numerical vector of probabilities.

two.sided

a logical flag indicating whether quantiles are supposed to correspond to the one-sided or two-sided spectrum.

...

currently unused.

Value

A matrix with columns corresponding to elements of probs, and rows corresponding to the Fourier frequencies x$freq. If probs is of length 1, a vector is returned instead.

Details

The posterior distribution is a product of independent scaled inverse \(\chi^2\) distributions.

See Also

bspec, quantile

Examples

Run this code
# NOT RUN {
lhspec <- bspec(lh)

# posterior medians:
print(cbind("frequency"=lhspec$freq,
            "median"=quantile(lhspec, 0.5)))
# }

Run the code above in your browser using DataLab