Simulates multivariate time series data using R-vine copulas while preserving the dependence structure and marginal distributions of the original data.

simulate_rvine(
  data,
  n = 100,
  seed = 123,
  verbose = FALSE,
  n_trials = 10,
  oversample_factor = 1.5,
  score_weights = c(0.4, 0.2, 0.2, 0.1, 0.1)
)

Arguments

data

Matrix or data.frame of multivariate time series

n

Number of simulations to generate

seed

Random seed for reproducibility

verbose

Whether to print fitting information

n_trials

Number of trials to select best fit

oversample_factor

Factor to oversample for better selection (default 1.5)

score_weights

Vector of weights for scoring criteria. Must be length 5 and sum to 1. Order: [Kendall_cor, Pearson_cor, KS_test, mean_error, sd_error]

Value

A list of class 'rvine_simulation' containing:

  • simulated_data - The simulated multivariate time series

  • diagnostics - Comprehensive diagnostic information including:

    • Correlation matrices and errors

    • Distribution comparison metrics

    • Quality scores and trial results

    • Model information

Examples

if (FALSE) { # \dontrun{
# Basic usage with default weights
result <- simulate_rvine(uschange, n = 200)

# Custom weights emphasizing correlation preservation
result <- simulate_rvine(uschange, n = 200, 
                        score_weights = c(0.6, 0.2, 0.1, 0.05, 0.05))

# Plot results
plot(result)
} # }