t_copula_two_vars {covalchemy} | R Documentation |
Generate t-Copula Samples for Two Variables
Description
This function generates samples from a t-copula with two variables, given the specified correlation coefficient between the variables.
Usage
t_copula_two_vars(n, p)
Arguments
n |
Integer. The number of samples to generate. |
p |
Numeric. The correlation coefficient ( |
Details
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.
Value
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]
.
See Also
Examples
# Example usage:
samples <- t_copula_two_vars(n = 1000, p = 0.7)
head(samples)
[Package covalchemy version 1.0.0 Index]