ES: Conditional Value-at-Risk (VaR) and Expected Shortfall (ES)

Description Usage Arguments Value Author(s) See Also Examples

View source: R/ES.R

Description

Extract the in-sample conditional Value-at-Risk, or the in-sample conditional Expected Shortfall for the chosen risk level(s).

Usage

1
2
ES(object, level=0.99, type=7, ...)
VaR(object, level=0.99, type=7, ...)

Arguments

object

an arx, gets or isat object

level

the risk level(s), must be between 0 and 1

type

the method used to compute the empirical quantiles of the standardised residuals

...

arguments passed on (currently not used)

Value

A vector or matrix containing either the conditional Value-at-Risk (VaR) or the conditional Expected Shortfall (ES) for the chosen risk level(s).

Author(s)

Genaro Sucarrat, http://www.sucarrat.net/

See Also

arx, getsm, getsv, isat

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
##generate random variates, estimate model:
y <- rnorm(50)
mymodel <- arx(y, arch=1)

##extract 99% expected shortfall:
ES(mymodel)

##extract 99%, 95% and 90% expected shortfalls:
ES(mymodel, level=c(0.99, 0.95, 0.9))

##extract 99% value-at-risk:
VaR(mymodel)

##extract 99%, 95% and 90% values-at-risk:
VaR(mymodel, level=c(0.99, 0.95, 0.9))

Example output

Loading required package: zoo

Attaching package: 'zoo'

The following objects are masked from 'package:base':

    as.Date, as.Date.numeric

       1        2        3        4        5        6        7        8 
      NA 1.738434 1.916398 1.518684 2.121341 1.978204 1.714355 1.402462 
       9       10       11       12       13       14       15       16 
1.601677 1.848147 1.828639 1.730188 2.216905 2.070627 1.986429 1.826304 
      17       18       19       20       21       22       23       24 
2.016680 2.031396 1.993361 2.180556 2.001659 1.784609 1.873171 2.200887 
      25       26       27       28       29       30       31       32 
2.262816 1.940184 1.961251 1.826189 2.027534 1.759446 2.053646 1.880379 
      33       34       35       36       37       38       39       40 
1.446908 2.166750 1.770050 1.935337 1.663050 2.041893 1.988453 1.744427 
      41       42       43       44       45       46       47       48 
2.116986 2.117202 2.099327 1.885160 2.171970 2.088764 1.972428 2.225912 
      49       50 
2.044190 1.747676 
     ES0.99   ES0.95    ES0.9
1        NA       NA       NA
2  1.738434 1.394170 1.207226
3  1.916398 1.536891 1.330810
4  1.518684 1.217937 1.054624
5  2.121341 1.701249 1.473129
6  1.978204 1.586458 1.373731
7  1.714355 1.374859 1.190505
8  1.402462 1.124731 0.973916
9  1.601677 1.284495 1.112258
10 1.848147 1.482156 1.283414
11 1.828639 1.466512 1.269868
12 1.730188 1.387556 1.201500
13 2.216905 1.777889 1.539492
14 2.070627 1.660578 1.437912
15 1.986429 1.593054 1.379442
16 1.826304 1.464639 1.268246
17 2.016680 1.617315 1.400449
18 2.031396 1.629116 1.410669
19 1.993361 1.598613 1.384256
20 2.180556 1.748738 1.514250
21 2.001659 1.605268 1.390019
22 1.784609 1.431201 1.239292
23 1.873171 1.502225 1.300792
24 2.200887 1.765043 1.528369
25 2.262816 1.814708 1.571374
26 1.940184 1.555967 1.347328
27 1.961251 1.572862 1.361958
28 1.826189 1.464546 1.268166
29 2.027534 1.626019 1.407987
30 1.759446 1.411021 1.221818
31 2.053646 1.646960 1.426120
32 1.880379 1.508006 1.305798
33 1.446908 1.160375 1.004781
34 2.166750 1.737666 1.504663
35 1.770050 1.419525 1.229181
36 1.935337 1.552080 1.343962
37 1.663050 1.333714 1.154877
38 2.041893 1.637535 1.417958
39 1.988453 1.594677 1.380848
40 1.744427 1.398976 1.211388
41 2.116986 1.697757 1.470105
42 2.117202 1.697930 1.470255
43 2.099327 1.683595 1.457842
44 1.885160 1.511840 1.309118
45 2.171970 1.741852 1.508288
46 2.088764 1.675123 1.450507
47 1.972428 1.581826 1.369720
48 2.225912 1.785112 1.545747
49 2.044190 1.639377 1.419554
50 1.747676 1.401582 1.213644
       1        2        3        4        5        6        7        8 
      NA 1.613795 1.778999 1.409800 1.969249 1.836375 1.591443 1.301911 
       9       10       11       12       13       14       15       16 
1.486843 1.715642 1.697533 1.606140 2.057961 1.922171 1.844009 1.695365 
      17       18       19       20       21       22       23       24 
1.872092 1.885753 1.850445 2.024218 1.858148 1.656659 1.738872 2.043092 
      25       26       27       28       29       30       31       32 
2.100581 1.801081 1.820637 1.695258 1.882167 1.633301 1.906408 1.745563 
      33       34       35       36       37       38       39       40 
1.343171 2.011402 1.643144 1.796581 1.543815 1.895497 1.845889 1.619359 
      41       42       43       44       45       46       47       48 
1.965206 1.965407 1.948814 1.750001 2.016248 1.939007 1.831013 2.066322 
      49       50 
1.897630 1.622375 
    VaR0.99   VaR0.95    VaR0.9
1        NA        NA        NA
2  1.613795 0.9630464 0.8397273
3  1.778999 1.0616336 0.9256904
4  1.409800 0.8413106 0.7335800
5  1.969249 1.1751669 1.0246856
6  1.836375 1.0958729 0.9555453
7  1.591443 0.9497075 0.8280966
8  1.301911 0.7769268 0.6774406
9  1.486843 0.8872870 0.7736690
10 1.715642 1.0238244 0.8927227
11 1.697533 1.0130179 0.8833000
12 1.606140 0.9584782 0.8357442
13 2.057961 1.2281068 1.0708466
14 1.922171 1.1470727 1.0001889
15 1.844009 1.1004290 0.9595180
16 1.695365 1.0117243 0.8821720
17 1.872092 1.1171875 0.9741306
18 1.885753 1.1253398 0.9812390
19 1.850445 1.1042695 0.9628667
20 2.024218 1.2079704 1.0532887
21 1.858148 1.1088664 0.9668750
22 1.656659 0.9886262 0.8620317
23 1.738872 1.0376874 0.9048105
24 2.043092 1.2192333 1.0631093
25 2.100581 1.2535402 1.0930232
26 1.801081 1.0748110 0.9371804
27 1.820637 1.0864815 0.9473565
28 1.695258 1.0116603 0.8821162
29 1.882167 1.1232002 0.9793733
30 1.633301 0.9746868 0.8498772
31 1.906408 1.1376657 0.9919865
32 1.745563 1.0416805 0.9082923
33 1.343171 0.8015490 0.6989099
34 2.011402 1.2003221 1.0466197
35 1.643144 0.9805611 0.8549993
36 1.796581 1.0721256 0.9348389
37 1.543815 0.9212856 0.8033141
38 1.895497 1.1311550 0.9863095
39 1.845889 1.1015505 0.9604959
40 1.619359 0.9663667 0.8426225
41 1.965206 1.1727544 1.0225820
42 1.965407 1.1728741 1.0226865
43 1.948814 1.1629720 1.0140523
44 1.750001 1.0443289 0.9106016
45 2.016248 1.2032139 1.0491412
46 1.939007 1.1571199 1.0089496
47 1.831013 1.0926733 0.9527554
48 2.066322 1.2330963 1.0751971
49 1.897630 1.1324276 0.9874191
50 1.622375 0.9681666 0.8441920

gets documentation built on Oct. 8, 2017, 1:03 a.m.