GithubHelp home page GithubHelp logo

rcovarcopula's Introduction

CoVaR value evaluting at quantile CoVaR and quantile VaR.

Description

Calculate the conditional quantile or CoVaR with different type of Copula and marginal distribution. In this package several bivariate copula families are included for bivariate analysis. It provides functionality of elliptical (Gaussian and Student t) as well as Archimedean (Clayton, Gumbel, Frank, Plackett, BB1, SCJ, rotated clayton and rotated Gumbel) copulas to cover a large bandwidth of possible dependence structures.

Author

Andrea Ugolini [email protected] \ Juan Carlos Reboredo Noguiera [email protected]

References

Reboredo, J. C., & Ugolini, A. (2016). Quantile dependence of oil price movements and stock returns. Energy Economics, 54, 33-49.

Example

RCoVaRCopula

load("Data_demo.Rdata") source("CoVaR.R") source("DynCopulaCoVaR.R") source("DynCopulaCoVaRUpper.R") source("skewtdis_inv.R") require("pracma") require("copula")

CoVaR Downside

CoVaR1part = CoVaR(0.05,0.05,par=par1_1,par2=par2_1,dof=tailBrazil,gamma=asyBrazil,cond.mean=meanBrasil1, cond.sigma=sigmaBrasil1,dist="tskew",type="Student")

CoVaR2part = CoVaR(0.05,0.05,par=par1_2,par2=par2_2,dof=tailBrazil,gamma=asyBrazil,cond.mean=meanBrasil2, cond.sigma=sigmaBrasil2,dist="tskew",type="Student")

CoVaR Upside

CoVaR1partUp = CoVaR(0.95,0.95,par=par1_1,par2=par2_1,dof=tailBrazil,gamma=asyBrazil,cond.mean=meanBrasil1, cond.sigma=sigmaBrasil1,dist="tskew",type="StudentUp")

CoVaR2partUp = CoVaR(0.95,0.95,par=par1_2,par2=par2_2,dof=tailBrazil,gamma=asyBrazil,cond.mean=meanBrasil2, cond.sigma=sigmaBrasil2,dist="tskew",type="StudentUp")

CoVaR1D = CoVaR1part$CoVaR CoVaR2D = CoVaR2part$CoVaR CoVaR1U = CoVaR1partUp$CoVaR CoVaR2U = CoVaR2partUp$CoVaR

TimeCoVaRD = rbind(CoVaR1D,CoVaR2D) TimeCoVaRU = rbind(CoVaR1U,CoVaR2U)

Plot

plot(as.matrix(TimeCoVaRD),type="l",col="blue", ylim=c(-0.5,0.5),xlab="Time",ylab="") lines(VaR,col="black",lty=2) lines(TimeCoVaRU,col="red",lty=4) lines(VaRup,col="green",lty=3) abline(h=0,col="gray33")

R Code CoVaR with Copula

rcovarcopula's People

Contributors

andrugo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.