Learn R Programming

STCCGEV (version 1.0.0)

log_likelihood_generalized_2d: Generalized Log-Likelihood Function for 2D Copula-GEV Model

Description

Computes the negative log-likelihood of a 2-dimensional copula-GEV model, incorporating dynamic Generalized Extreme Value (GEV) parameters and a time-varying copula structure.

Usage

log_likelihood_generalized_2d(params, u1, u2, X_t, z1, z2, copula)

Value

The negative log-likelihood value for optimization.

Arguments

params

Numeric vector, model parameters including copula and GEV parameters.

u1

Numeric vector (length n_train), pseudo-observations for margin 1.

u2

Numeric vector (length n_train), pseudo-observations for margin 2.

X_t

Numeric matrix (n_train x M), risk factors affecting copula parameters.

z1

Numeric matrix (n_train x M), observed data for margin 1.

z2

Numeric matrix (n_train x M), observed data for margin 2.

copula

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

Examples

Run this code
test_ll_2d <-log_likelihood_generalized_2d(init_params_full,
                                  uu[,1],
                                  uu[,2],
                                  xx_train,
                                  zz_train[,1,],
                                  zz_train[,2,],
                                  "Gaussian")

Run the code above in your browser using DataLab