rmvtDCT {mrbsizeR} | R Documentation |
Sampling from marginal posterior multivariate t-distribution.
Description
Samples from a marginal posterior multivariate t-distribution with normal-inverse-chi-squared-prior are generated.
Usage
rmvtDCT(object, lambda, sigma, nu0, ns)
Arguments
object |
Observed object, as |
lambda |
Scaling parameter ( |
sigma |
Square root of the |
nu0 |
Degrees of freedom ( |
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
Samples of the marginal posterior of the input as column vectors.
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
# 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)