Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: VaR
See also: VaRest VaRpred VaRdiagplot VaRdiagtable VaRtimeplot

Quantlet: VaRgrdiag
Description: produces calibration and discrimination plots which verify validity of probability forecasts.

Usage: {freq,calibr,discr}=VaRgrdiag(int,sig,real,g)
Input:
int mx2 matrix containing intervals in the rows.
sig nx1 vector of predicted standard deviations (assume normality)
real nx1 vector of realizations.
g scalar, number of grid points.
Output:
freq graphical object containing rel. frequencies of the probability forecasts calculated on the given number of grid points.
calibr graphical object containing the calibration plot.
discr graphical object containing the discrimination plot.

Example:
library("VaR")
x=read("kupfer")       ; time series
x=x[1:1001]
y=diff(log(x))         ; returns
sig=VaRest(y)[,2]/qfn(0.99)
sig2=VaRest(y,"EMA")[,2]/qfn(0.99)
y=y[251:1000]
intervals=(-0.01~0.01)|(-0.017~0.017)|(-0.005~0.005)|(-0.002~0.002)
{fr1,ca1,di1}=VaRgrdiag(intervals,sig,y,5)
{fr2,ca2,di2}=VaRgrdiag(intervals,sig2,y,5)
disp=createdisplay(2,3)
show(disp,1,1,fr1)
show(disp,1,2,ca1)
show(disp,1,3,di1)
show(disp,2,1,fr2)
show(disp,2,2,ca2)
show(disp,2,3,di2)

Result:
Graphics comparing two methods of VaR prediction from the
"probability forecasts" point of view.



Author: Z. Hlavka, 20000713 license MD*Tech
(C) MD*TECH Method and Data Technologies, 05.02.2006