垃圾桶

b一世nomial test for value-at-risk (VaR) backtesting

Description

例子

testResults= bin(<一个Href="#bvabigr-1-vbt" class="intrnllnk">vbtgenerates the binomial test results for value-at-risk (VaR) backtesting.

例子

testResults= bin(<一个Href="#bvabigr-1-vbt" class="intrnllnk">vbt,,,,<一个Href="#namevaluepairarguments" class="intrnllnk">名称,价值添加了一个可选的名称值对参数<一个Href="#bvabigr-1-TestLevel" class="intrnllnk">testLevel

Examples

全部收缩

创建一个varbacktest目的。

加载varbacktestdatavbt = varbacktest(equityIndex,normal95)
vbt =带有属性的varbacktest:portfoliodata:[1043x1 double] vardata:[1043x1 double] portfolioid:“ portfolio” varid:“ var” varlevel:0.9500:0.9500

Generate the垃圾桶测试results.

testResults = bin(vbt)
testResults=1×9桌PortfolioID VaRID VaRLevel Bin ZScoreBin PValueBin Observations Failures TestLevel ___________ _____ ________ ______ _________ _________ ____________ ________ _________ "Portfolio" "VaR" 0.95 accept 0.68905 0.49079 1043 57 0.95

使用varbacktestConstructor with name-value pair arguments to create avarbacktest目的。

加载varbacktestdatavbt = varbacktest(EquityIndex,...[Normal95 Normal99 Historical95 Historical99 EWMA95 EWMA99],...'PortfolioID',,,,'公平',,,,...'varid',,,,{'Normal95''正常99'“历史95”'Historical99''ewma95''EWMA99'},...“ varlevel”,,,,[0.95 0.99 0.95 0.99 0.95 0.99])
vbt = varbacktest with properties: PortfolioData: [1043x1 double] VaRData: [1043x6 double] PortfolioID: "Equity" VaRID: [1x6 string] VaRLevel: [0.9500 0.9900 0.9500 0.9900 0.9500 0.9900]

Generate the垃圾桶使用testLevel可选的论点。

testResults = bin(vbt,'sTlelevel',,,,0。90)
testResults=6×9桌子portfolioID VaRID VaRLevel Bin ZScoreBin PValueBin Observations Failures TestLevel ___________ ______________ ________ ______ _________ _________ ____________ ________ _________ "Equity" "Normal95" 0.95 accept 0.68905 0.49079 1043 57 0.9 "Equity" "Normal99" 0.99 reject 2.0446 0.040896 1043 17 0.9 "Equity" "Historical95" 0.95 accept 0.9732 0.33045 1043 59 0.9 "Equity" "Historical99" 0.99 accept 0.48858 0.62514 1043 12 0.9 "Equity" "EWMA95" 0.95 accept 0.9732 0.33045 1043 59 0.9 "Equity" "EWMA99" 0.99 reject 3.6006 0.0003175 1043 22 0.9

输入参数

全部收缩

varbacktest((vbt)对象,包含给定数据的副本(投资组合一个nd瓦尔达塔propert一世es) and all combinations of portfolio ID, VaR ID, and VaR levels to be tested. For more information on creating avarbacktest对象,请参阅<一个Href="//www.tatmou.com/help/risk/varbacktest.html">varbacktest

姓名-Value Pair Arguments

指定可选的逗号分隔对名称,价值一个rguments.姓名是参数名称和v一个l你e一世s the corresponding value.姓名must appear inside quotes. You can specify several name and value pair arguments in any order as姓名1,,,,v一个l你e1,,,,。。。,,,,n一个meN,ValueN

Example:testResults = bin(vbt,'TestLevel',0.99)

测试置信度水平,指定为逗号分隔对'sTlelevel'和两个之间的数字0一个nd1

数据类型:双倍的

输出参数

全部收缩

本测试结果,ro作为表返回ws correspond to all combinations of portfolio ID, VaR ID, and VaR levels to be tested. The columns correspond to the following information:

  • 'PortfolioID'- 给定数据的投资组合ID

  • 'varid'- 提供的每个VAR数据列的VAR ID

  • “ varlevel”- 相应的VAR数据列的VAR级别

  • '垃圾桶​​'-Categorical array with categories接受一个ndreject这表明了垃圾桶测试

  • 'zscorebin'- 失败数量的z得分

  • 'PValueBin'-p-value of the垃圾桶测试

  • “观察”- 观察次数

  • “失败”- 失败数量。

  • 'sTlelevel'- 测试置信度水平。

笔记

为了垃圾桶测试results, the terms接受一个ndreject用于方便,从技术上讲垃圾桶测试does not accept a model. Rather, the test fails to reject it.

更多关于

全部收缩

二项式测试((b一世n)

垃圾桶功能执行二项式测试,以评估故障数是否与VAR置信度水平一致。

这垃圾桶omial test is based on a normal approximation to the binomial distribution.

Algorithms

二项式测试的结果基于二项式分布的正常近似。认为:

  • n一世s the number of observations.

  • p=1-v一个RLevel如果模型正确,则观察故障的可能性是。

  • X是失败的数量。

If the failures are independent, then the number of failures is distributed as a binomial distribution with parametersn一个ndp。预期的失败数为n*p,失败数的标准偏差是

n p (( 1 - p

测试统计量垃圾桶测试是z得分,定义为:

z s C o r e b 一世 n = (( X - n p n p (( 1 - p

z得分大约遵循标准正态分布。这种近似值对于小值norsmall values ofp,,,,b你tfor typical uses in VaR backtesting analyses (n=250ormuch larger,p在1–10%的范围内)近似值与其他测试一致。

尾巴的概率垃圾桶测试是标准正态分布超过z得分的绝对值的概率

t 一个 一世 l p r o b 一个 b 一世 l 一世 t y = 1 - F (( | z s C o r e b 一世 n |

在哪里F是标准的正常累积分布。当观察到的失败太少时,相对于预期的失败,pv一个l你eb一世n是(大约)观察许多失败或更少的概率。对于太多的失败,这是(大约)观察到许多失败或更多失败的可能性。

p-value of the垃圾桶测试一世s defined as two times the tail probability. This is because the binomial test is a two-sided test. Ifα定义为1减去测试置信度,测试拒绝如果尾巴概率少于一半α,,,,orequivalently if

p v 一个 l e b 一世 n = 2 * t 一个 一世 l p r o b 一个 b 一世 l 一世 t y < 一个 l p H 一个

References

[1] Jorion, P.财务风险经理手册。第六版。Wiley Finance,2011年。

在R2016b中引入