Copula_Threshold_2D: Copula Selection With threshold 2D - Fit

View source: R/Copula_Threshold_2D.R

Copula_Threshold_2DR Documentation

Copula Selection With threshold 2D - Fit

Description

Declustered excesses of a (conditioning) variable are paired with co-occurences of the other variable before the best fitting bivariate copula is selected, using BiCopSelect function in the VineCopula package, for a single or range of thresholds. The procedure is automatically repeated with the variables switched.

Usage

Copula_Threshold_2D(
  Data_Detrend,
  Data_Declust,
  u1 = seq(0.9, 0.99, 0.01),
  u2 = seq(0.9, 0.99, 0.01),
  PLOT = TRUE,
  x_lim_min = NA,
  x_lim_max = NA,
  y_lim_min = -1,
  y_lim_max = 1,
  Upper = 0,
  Lower = 0,
  GAP = 0.05,
  Legend = TRUE
)

Arguments

Data_Detrend

Data frame containing two at least partially concurrent time series, detrended if necessary. Time steps must be equally spaced, with missing values assigned NA.

Data_Declust

Data frame containing two (independently) declustered at least partially concurrent time series. Time steps must be equally spaced, with missing values assigned NA.

u1

A single or sequence of thresholds, given as a quantile of the observations of the variable in the first column of Data_Detrend when it is used as the conditioning variable. Default, sequence from 0.9 to 0.99 at intervals of 0.01.

u2

A single or sequence of thresholds, given as a quantile of the observations of the variable in the second column of Data_Detrend when it is used as the conditioning variable. Default, sequence from 0.9 to 0.99 at intervals of 0.01.

PLOT

Logical; whether to plot the results. Default is "TRUE".

x_lim_min

Numeric vector of length one specifying x-axis minimum. Default is NA.

x_lim_max

Numeric vector of length one specifying x-axis maximum. Default is NA.

y_lim_min

Numeric vector of length one specifying y-axis minimum. Default -1.0.

y_lim_max

Numeric vector of length one specifying y-axis maximum. Default 1.0.

Upper

Numeric vector specifying the element number of the u1 argument for which the copula family name label to appear above the corresponding point on the Kendall's tau coefficient vs threshold plot, when conditioning on the variable in column 1. Default is 0.

Lower

Numeric vector specifying the element number of the u2 argument for which the copula family name label to appear below the corresponding point on the Kendall's tau coefficient vs threshold plot, when conditioning on the variable in column 2. Default is 0.

GAP

Numeric vector of length one specifying the distance above or below the copula family name label appears the corresponding point on the Kendall's tau coefficient vs threshold plot. Default is 0.05.

Legend

Logic vector of length one specifying whether a legend should be plotted. Default is TRUE.

Value

List comprising:

  • Kendalls_Tau1 Kendall's tau of a sample

  • p_value_Var1 p-value when testing the null hypothesis H_0: tau=0 i.e. that there is no correlation between the variables

  • N_Var1 Size of the dataset

  • Copula_Family_Var1 Best fitting copula for the specified thresholds

when the dataset is conditioned on the variable in column 1. Analogous vectors Kendalls_Tau2,p_value_Var2, N_Var2 and Copula_Family_Var2 for the specified thresholds when the dataset is conditioned on the variable in column 2.

See Also

Dataframe_Combine

Examples

Copula_Threshold_2D(Data_Detrend=S20.Detrend.df[,-c(1,4)],
                    Data_Declust=S20.Detrend.Declustered.df[,-c(1,4)],
                    y_lim_min=-0.075, y_lim_max =0.25,
                    Upper=c(6,8), Lower=c(6,8),GAP=0.1)

rjaneUCF/MultiHazard documentation built on April 20, 2024, 12:48 a.m.