m一种in Content

simulate

模拟预期缺口(ES)测试统计数据

Description

例子

ebts=simulate(<一种href="//www.tianjin-qmedu.com/au/help/risk/#mw_cd6c817b-f498-42da-bf4a-8e7674a1f3cf" class="intrnllnk">ebts进行ES测试统计数据的模拟。这simulate函数根据在<一种href="//www.tianjin-qmedu.com/au/help/risk/esbacktestbysim.html">esb一种cktestbysim目的,,,,一种nd calculates all the supported test statistics under each scenario. The simulated test statistics are used to estimate the significance of the ES backtests.

例子

ebts=simulate(<一种href="//www.tianjin-qmedu.com/au/help/risk/#mw_cd6c817b-f498-42da-bf4a-8e7674a1f3cf" class="intrnllnk">ebts,,,,<一种href="//www.tianjin-qmedu.com/au/help/risk/#namevaluepairarguments" class="intrnllnk">姓名,,,,Value一种dds optional name-value pair arguments.

Examples

collapse all

创建一个esb一种cktestbysim目的一种nd run a simulation of 1000 scenarios.

加载EsbackTestBysimdatarng('default');%可再现性ebts=esb一种cktestbysim(Returns,VaR,ES,"t",,,,...'自由程度',10,...'Location',,,,m你,,,,...'Scale',Sigma,...'PortfolioID',,,,“标准普尔”,,,,...'varid',,,,[“ T(10)95%”,,,,“ T(10)97.5%”,,,,"t(10) 99%"],...'VaRLevel',varlevel);

无条件一种ndminBiasAbsolute测试sreport 1000 scenarios (see the方案报告中的列)。

无条件(EBT)
一种ns=3×10 tableportfolioID VaRID VaRLevel Unconditional PValue TestStatistic CriticalValue Observations Scenarios TestLevel ___________ _____________ ________ _____________ ______ _____________ _____________ ____________ _________ _________ "S&P" "t(10) 95%" 0.95 accept 0.093 -0.13342 -0.16252 1966 1000 0.95 "S&P" "t(10) 97.5%" 0.975 reject 0.031 -0.25011 -0.2268 1966 1000 0.95 "S&P" "t(10) 99%" 0.99 reject 0.008 -0.57396 -0.38264 1966 1000 0.95
Minbiasabsolute(EBTS)
一种ns=3×10 tablePortfolioID VaRID VaRLevel MinBiasAbsolute PValue TestStatistic CriticalValue Observations Scenarios TestLevel ___________ _____________ ________ _______________ ______ _____________ _____________ ____________ _________ _________ "S&P" "t(10) 95%" 0.95 accept 0.062 -0.0014247 -0.0015578 1966 1000 0.95 "S&P" "t(10) 97.5%“ 0.975拒绝0.029 -0.0026674 -0.0023251 1966 1000 0.95” s&p“” T(10)99%“ 0.99拒绝0.005 -0.0060982 -0.003982 -0.0039004 1966 1000 0.950 0.95

Run a second simulation with5000场景使用simulate功能。重新运行无条件一种ndminBiasAbsolute测试s你sing the updatedesb一种cktestbysim目的。notice that the tests now show 5,000 scenarios along with updatedp- 值和临界值。

ebts=simulate(ebts,“阻止”,10000,'NumScenarios',,,,5000,“测试清单”,,,,[“条件”,,,,“无条件”,,,,"quantile",,,,“ Minbiasabsolute”,,,,"minBiasRelative"]); unconditional(ebts)
一种ns=3×10 tablePortfolioID VaRID VaRLevel Unconditional PValue TestStatistic CriticalValue Observations Scenarios TestLevel ___________ _____________ ________ _____________ ______ _____________ _____________ ____________ _________ _________ "S&P" "t(10) 95%" 0.95 accept 0.0952 -0.13342 -0.17352 1966 5000 0.95 "S&P" "t(10) 97.5%“ 0.975拒绝0.0456 -0.25011 -0.24318 1966 5000 0.95” S&P”“ T(10)99%” 0.99拒绝0.009 -0.57396 -0.38608 1966 5000 0.95
minbiasabsolute(ebts,"TestLevel",0.99)
一种ns=3×10 tableportfolioID VaRID VaRLevel MinBiasAbsolute PValue TestStatistic CriticalValue Observations Scenarios TestLevel ___________ _____________ ________ _______________ ______ _____________ _____________ ____________ _________ _________ "S&P" "t(10) 95%" 0.95 accept 0.0622 -0.0014247 -0.0021797 1966 5000 0.99 "S&P" "t(10) 97.5%" 0.975 accept 0.026 -0.0026674 -0.0032702 1966 5000 0.99 "S&P" "t(10) 99%" 0.99 reject 0.006 -0.0060982 -0.0054814 1966 5000 0.99

输入参数

collapse all

esb一种cktestbysim((ebts)对象,其中包含给定数据的副本(投资组合,,,,瓦尔达塔,,,,ESData,,,,一种ndDistribution属性)以及要测试的投资组合ID,VAR ID和VAR级别的所有组合。有关创建的更多信息esb一种cktestbysim对象,请参阅<一种href="//www.tianjin-qmedu.com/au/help/risk/esbacktestbysim.html">esb一种cktestbysim

名称值参数

Specify optional pairs of arguments asname1 = value1,...,namen = valuen,,,,在哪里姓名是参数名称和Valueis the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

在R2021a之前,请使用逗号分隔每个名称和值,并附上姓名用引号。

Example:ebts=simulate(ebts,'NumScenarios',1000000,'BlockSize',10000,'TestList','conditional')

n你mber of scenarios to simulate, specified using the comma-separated pair consisting of'NumScenarios'一种nd a positive integer.

数据类型:double

n你mber of scenarios to simulate in a single simulation block, specified using the comma-separated pair consisting of“阻止”一种nd a positive integer.

数据类型:double

指标用于模拟哪种测试统计信息,,,,specified as the comma-separated pair consisting of“测试清单”和字符向量的单元格数组或带有值的字符串数组有条件,,,,无条件,,,,分位数,,,,minBiasAbsoluteorminBiasRelative

数据类型:char|cell|细绳

输出参数

collapse all

esb一种cktestbysim((ebts),作为更新对象返回。运行后simulate,,,,the updatedesb一种cktestbysim目的stores the simulated test statistics, which are used to calculatep- 值并生成测试结果。

有关有关的更多信息esb一种cktestbysim对象,请参阅<一种href="//www.tianjin-qmedu.com/au/help/risk/esbacktestbysim.html">esb一种cktestbysim

更多关于

collapse all

Simulation of Test Statistics and Significance of the Tests

这VaR and ES models assume that for each periodt,,,,the portfolio outcomesXt具有累积概率分布pt

假设分布pt是正确的(零假设),测试统计数据由以下方式模拟:

  • Simulatingmscenarios ofn例如,每个观察 X s = (( X 1 s ,,,, ... ,,,, X t s ,,,, ... ,,,, X n s ,,,,with X t s p t ,,,,t=1,,,,…,n,,,,一种nds=1,,,,…,m

  • 对于每个模拟场景Xs,计算感兴趣的测试统计数据zs=z((Xs),,,,s=1,,,,…,m

  • 这resultingmsimulated test statistic valuesz1,,,,…,zmfrom a distribution of the test statistic assuming the probability distributionspt一种re correct.

p- 值定义为模拟测试统计量的场景比例小于在观察到的投资组合结果中评估的测试统计量: z o b s = z (( X 1 ,,,, ... X n

p v 一种 l e = 1 m s = 1 m 一世 (( z s z o b s

在哪里一世((zszobs)is an indicator function with a value of1ifzszobs,,,,一种nd0otherwise. Ifp测试is1减去测试置信度,测试结果是'拒绝'if p v 一种 l e < p t e s t

临界值定义为最小模拟测试统计量zcritp- 价值大于或等于p测试

References

[1] Acerbi,C。和B. Szekely。进行回测的预期不足。MSCI Inc. 2014年12月。

版本历史记录

在R2017b中引入