View source: R/generate_t_copula_samples.R
generate_t_copula_samples | R Documentation |
This function generates samples from a t-copula given a specified correlation
matrix and degrees of freedom. The samples are uniformly distributed in [0, 1]
.
across dimensions.
generate_t_copula_samples(n, d, rho_matrix, df)
n |
Integer. The number of samples to generate. |
d |
Integer. The dimensionality of the copula. |
rho_matrix |
A |
df |
Numeric. The degrees of freedom of the t-distribution. Must be positive. |
The function works as follows:
Generates multivariate t-distributed samples using the specified correlation matrix and degrees of freedom.
Transforms the samples to the uniform distribution [0, 1]
using the
cumulative distribution function (CDF) of the t-distribution.
A matrix of size n x d
, where each row represents a sample
and each column corresponds to a dimension. The values are uniformly
distributed in [0, 1]
.
# Example usage:
library(mvtnorm) # Load package for `rmvt`
rho_matrix <- diag(3) # 3x3 identity matrix as correlation matrix
samples <- generate_t_copula_samples(n = 1000, d = 3, rho_matrix = rho_matrix, df = 5)
head(samples)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.