Giter VIP home page Giter VIP logo

caviar's Introduction

RCaviar

R code for estimation of CAViaR models.

This function was created on the basis of Robert F. Engle & Simone Manganelli, 2004. "CAViaR: Conditional Autoregressive Value at Risk by Regression Quantiles," Journal of Business & Economic Statistics, American Statistical Association, vol. 22, pages 367-381, October.

Its aim is to calculate CAViaR values, based on provided data, selected model and value at risk probability level. To know more about CAViaR please refer to the cited article or an article of my own: Buczynski M., Chlebus M., "Is CAViaR model really so good in Value at Risk forecasting? Evidence from evaluation of a quality of Value-at-Risk forecasts obtained based on the: GARCH(1,1), GARCH-t(1,1), GARCH-st(1,1), QML-GARCH(1,1), CAViaR and the historical simulation models depending on the stability of financial markets" Working Papers 2017-29, Faculty of Economic Sciences, University of Warsaw.

Input:

  • data - numeric - data for the CAViaR model to calculate risk (convertible to numerical)
  • model - numeric - model type (1 - SAV, 2 - AS, 3 - GARCH, 4 - ADAPTIVE) (defaults to 1)
  • pval - numeric - level of value at risk probability (defaults to 0.01)
  • REP - numeric - number of hessian optimization procedure repeats
  • MAXITER - numeric - maximum number of optimization procedure iterations
  • predict - logical - whether to return only predicted value for next period or whole list
  • k - numeric - optional parameter for ADAPTIVE model

Models

SAV:

CAVIAR MODEL

AS:

CAVIAR MODEL

Indirect GARCH(1,1):

CAVIAR MODEL

Adaptive:

CAVIAR MODEL

Output:

  • outL - list:
    • bestVals - numeric - best cost function values
    • bestPar - numeric - best parameters
    • VaR - numeric - calculated Value at Risk
    • bestRQ - numeric - best cost function among all
    • VarPredict - numeric - predicted value at risk for the next period (tail(VaR,1))

Test case

This repo also contains test case, so feel free to use it.

Here is also an example of prediction accuracy on randomly chosen polish WIG index data (detailed indices in test_case.csv and test_case.R) CAVIAR MODEL

caviar's People

Contributors

buczman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  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.