Learn R Programming

STCCGEV (version 1.0.0)

simul.fun.noGEV: Simulate Multivariate Crop Yield Data Using a Generalized Copula-BSTS Model Without GEV Covariates

Description

This function simulates multivariate crop yield data using a time-varying copula combined with Bayesian Structural Time Series (BSTS) models without GEV covariates for comparision.

Usage

simul.fun.noGEV(
  nsim = 100,
  n_train,
  n_test,
  copula,
  init_params,
  fn,
  U_train,
  Z_train,
  Z_test,
  X_train,
  X_test,
  Y_test,
  BSTS_list
)

Value

A list containing:

optim_results

Results from the optimization process.

theta_sim

Simulated copula parameters across replications.

Y_sim

Simulated final BSTS-based forecasts.

MSE

Mean squared error for each simulation run.

Arguments

nsim

Integer, number of simulation replications.

n_train

Integer, number of training observations.

n_test

Integer, number of test observations.

copula

Character, specifying the copula type: "Clayton", "Frank", "Gumbel", "Joe", or "Gaussian".

init_params

Numeric vector, initial parameter values for optimization.

fn

Function, log-likelihood function for parameter estimation.

U_train

Numeric matrix (n_train x D), pseudo-observations for the copula.

Z_train

Numeric array (n_train x D x M), observed data for each margin and sub-feature.

Z_test

Numeric array (n_test x D x M), observed data for each margin and sub-feature.

X_train

Numeric matrix (n_train x M), risk factors for the dynamic copula parameter.

X_test

Numeric matrix (n_test x M), risk factors for the dynamic copula parameter.

Y_test

Numeric matrix (n_test x D), true future values for MSE calculation.

BSTS_list

List of length D, each element is a BSTS model for a different margin.