View source: R/t_copula_two_vars.R
t_copula_two_vars | R Documentation |
This function generates samples from a t-copula with two variables, given the specified correlation coefficient between the variables.
t_copula_two_vars(n, p)
n |
Integer. The number of samples to generate. |
p |
Numeric. The correlation coefficient ( |
The function internally constructs a correlation matrix for two variables:
\rho_matrix = \begin{bmatrix} 1 & p \\ p & 1 \end{bmatrix}
It then calls generate_t_copula_samples
to generate samples using
a t-distribution with 5 degrees of freedom.
A matrix of size n x 2
, where each row represents a sample,
and each column corresponds to one of the two variables. The values
are uniformly distributed in [0, 1]
.
generate_t_copula_samples
# Example usage:
samples <- t_copula_two_vars(n = 1000, p = 0.7)
head(samples)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.