rmvtDCT: Sampling from marginal posterior multivariate t-distribution.

Description Usage Arguments Details Value Examples

View source: R/rmvtDCT.R

Description

Samples from a marginal posterior multivariate t-distribution with normal-inverse-chi-squared-prior are generated.

Usage

1
rmvtDCT(object, lambda, sigma, nu0, ns)

Arguments

object

Observed object, as matrix.

lambda

Scaling parameter (λ) of the normal-inverse-chi-squared-prior.

sigma

Square root of the σ_{0}^{2} parameter of the normal-inverse-chi-squared-prior.

nu0

Degrees of freedom (ν_{0}) of the normal-inverse-chi-square-prior.

ns

Number of samples that should be generated.

Details

An eigenvalue decomposition is used for sampling. To speed up computations, a 2D discrete cosine transform (DCT) has been implemented, see dctMatrix. The output is a list containing

  1. Samples of the marginal posterior of the input as column vectors.

  2. The mean of the marginal posterior of the input as a vector.

Value

A list containing the following elements:

sample Samples of the marginal posterior of the input.

mu Mean of the marginal posterior of the input.

Examples

1
2
3
4
5
6
7
8
# Artificial sample data
set.seed(987)
sampleData <- matrix(stats::rnorm(100), nrow = 10)
sampleData[4:6, 6:8] <- sampleData[4:6, 6:8] + 5

# Sampling from a multivariate t-distribution
t_dist_samp <- rmvtDCT(object = sampleData, lambda = 1, sigma = 10,
                       nu0 = 50, ns = 1000)

romanflury/mrbsizeR documentation built on Dec. 15, 2019, 9:30 p.m.