Vine_Copula_Sim: C and D-vine Copula - Simulation

Description Usage Arguments Value See Also Examples

View source: R/Vine_Copula_Sim.R

Description

Simulating from specified C- and D-vine copula models. Builds on the CDVineSim in CDVine.

Usage

1
2
Vine_Copula_Sim(Data, Marginals, Vine_family, Vine_par, Vine_par2,
  Vine_Type = "DVine", mu = 365.25, N = 10000)

Arguments

Data

Data frame containing n at least partially concurrent time series. First column may be a "Date" object. Can be Dataframe_Combine output.

Marginals

An migpd object containing the d-independent generalized Pareto models.

Vine_family

A n*(n-1)/2 integer vector specifying the pair-copula families defining the fitting C- or a D-vine copula models. Can be specified as the Family argument of a Vine_Copula_Fit object. See help file of the CDVineSim function to find the integers representing the different copula families.

Vine_par

A n*(n-1)/2 vector of pair-copula parameters.

Vine_par2

A n*(n-1)/2 vector of second parameters for pair-copula families with two parameters.

Vine_Type

Type of the vine model:

  • 1 or "CVine" = C-vine

  • 2 or "DVine" = D-vine

Can be specified as the Type argument of a Vine_Copula_Fit object.

mu

(average) Number of events per year. Numeric vector of length one. Default is 365.25, daily data.

N

Number of years worth of extremes to be simulated. Numeric vector of length one. Default 10,000 (years).

Value

List comprising an integer vector specifying the pair-copula families composing the C- or D-vine copula Vine_family, its parameters Vine_par and Vine_par2 and type of regular vine Vine_Type. In addition, data frames of the simulated observations: u.Sim on the transformed $[0,1]^n$ and x.Sim the original scales.

See Also

Vine_Copula_Fit

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#Fitting vine copula
S20.Vine<-Vine_Copula_Fit(Data=S20.Detrend.df, FamilySet=NA,
                          Type="DVine", SelCrit="AIC",Indeptest=FALSE,
                          Level=0.05)
#Simulating from fitted copula
S20.Vine.Sim<-Vine_Copula_Sim(Data=S20.Detrend.df,Marginals=S20.Migpd,
                              Vine_family=S20.Vine$Family, Vine_par=S20.Vine$Par,
                              Vine_par2=S20.Vine$Par2, Vine_Type="DVine",N=10)
#Plotting observed (black) and simulated (red) values
S20.Pairs.Plot.Data<-data.frame(rbind(na.omit(S20.Detrend.df[,-1]),S22.Vine.Sim$x.Sim),
                                c(rep("Observation",nrow(na.omit(S20.Detrend.df))),
                                rep("Simulation",nrow(S20.Vine.Sim$x.Sim))))
colnames(S20.Pairs.Plot.Data)<-c(names(S20.Detrend.df)[-1],"Type")
pairs(S20.Pairs.Plot.Data[,1:3],
      col=ifelse(S20.Pairs.Plot.Data$Type=="Observation","Black","Red"),
      upper.panel=NULL)

rjaneUCF/MultiHazard-R-Package documentation built on Jan. 28, 2021, 12:07 a.m.