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 VaRdiagplot VaRgrdiag VaRtimeplot

Quantlet: VaRdiagtable
Description: produces table containing frequencies of predictive probabilities of the observations falling into specified intervals.

Usage: table = VaRdiagtable(int,sig,real,g)
Input:
int mx2 matrix containing the 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:
table g x 3 matrix, the "contingency table", 1st column contains relative frequencies of predicted probabilities. 2nd and 3rd column contain relative frequencies of predicted probabilities conditioned on the result (whether the observations fall inside or outside the specified interval)

Example:
library("VaR")
x=read("kupfer")       ; time series
x=x[1:1001]
y=diff(log(x))         ; returns
sig=VaRest(y)[,2]/qfn(0.99)
y=y[251:1000]
VaRdiagtable((-0.01~0.01),sig,y,10)

Result:
[ 1,]        0        0        0
[ 2,]        0        0        0
[ 3,]        0        0        0
[ 4,]       15        8        7
[ 5,]       90       41       49
[ 6,]      520      317      203
[ 7,]      125       97       28
[ 8,]        0        0        0
[ 9,]        0        0        0
[10,]        0        0        0



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