2014-12-02 1 views
2

R에 익숙하지 않습니다. "PerformanceAnalytics"패키지를 사용하여 포트폴리오의 구성 요소 VaR을 계산합니다.

가우시안 방법을 사용하면 글을 기여도로 환불합니다.구성 요소 VaR에서 R의 기록 방법을 사용하지 않음

> VaR(edhec, p=.95, method="gaussian", portfolio_method="component") 
no weights passed in, assuming equal weighted portfolio 
$VaR 
      [,1] 
[1,] 0.01193358 

$contribution 
Convertible Arbitrage    CTA Global Distressed Securities  Emerging Markets Equity Market Neutral   Event Driven Fixed Income Arbitrage 
      0.0014400703   0.0003687009   0.0012961865   0.0032090406   0.0003479361   0.0013848605   0.0010051944 
      Global Macro  Long/Short Equity  Merger Arbitrage   Relative Value   Short Selling   Funds of Funds 
      0.0011151866   0.0015860006   0.0004412756   0.0009265836   -0.0027498306   0.0015623733 

$pct_contrib_VaR 
Convertible Arbitrage    CTA Global Distressed Securities  Emerging Markets Equity Market Neutral   Event Driven Fixed Income Arbitrage 
      0.12067381    0.03089608    0.10861675    0.26890849    0.02915606    0.11604738    0.08423244 
      Global Macro  Long/Short Equity  Merger Arbitrage   Relative Value   Short Selling   Funds of Funds 
      0.09344947    0.13290235    0.03697764    0.07764507   -0.23042800    0.13092245 

> 



하지만 난 그냥이 정확 하나의 포트폴리오 레벨 값

> VaR(edhec, p=.95, method="historical", portfolio_method="component") 
no weights passed in, assuming equal weighted portfolio 
[1] 0.01439231 
> 


을 반환역사적 방법을 사용하는 경우? 내가 놓친 게 있니?

편집
역사적인 시뮬레이션 방법을 사용하여 각 부품의 구성 부품 VaR을 계산하고 싶습니다.

+0

의 다음 릴리스에 포함됩니다 VaR)'통찰력을 주시겠습니까? –

답변

6

'historical'메소드는 '시뮬레이션'메소드가 아닙니다. 이는 실현 된 역사적 손실 quantile의 척도입니다.

R-Forge의 v 1.4.3574에서 PerformanceAnaltytics에 대한 과거 기여도를 추가했습니다.

는 귀하의 예는 지금 생산

:

> VaR(edhec, p=.95, method="historical", portfolio_method="component") 
no weights passed in, assuming equal weighted portfolio 
$hVaR 
    hVaR 95% 
0.01419502 

$contribution 
Convertible.Arbitrage    CTA.Global Distressed.Securities  Emerging.Markets Equity.Market.Neutral   Event.Driven Fixed.Income.Arbitrage   Global.Macro  Long.Short.Equity 
     -0.0006396664   -0.0001887839   -0.0007621405   -0.0020091076   -0.0001331756   -0.0008771216   -0.0004113300   -0.0006202640   -0.0010782781 
    Merger.Arbitrage   Relative.Value   Short.Selling   Funds.of.Funds 
    -0.0002735736   -0.0005046562   0.0012263158   -0.0008257281 

$pct_contrib_hVaR 
Convertible.Arbitrage    CTA.Global Distressed.Securities  Emerging.Markets Equity.Market.Neutral   Event.Driven Fixed.Income.Arbitrage   Global.Macro  Long.Short.Equity 
     0.09012547    0.02659862    0.10738139    0.28307218    0.01876371    0.12358159    0.05795412    0.08739178    0.15192344 
    Merger.Arbitrage   Relative.Value   Short.Selling   Funds.of.Funds 
     0.03854501    0.07110328   -0.17278113    0.11634054 

`도움 (합니까 지금, '곧'바이너리 형태로 사용할 수 있어야 SVN에서 사용할 수 있으며, PerformanceAnalytics

+0

누구나 할 수있는 가장 유용한 솔루션입니다. 감사 :) –

0

portfolio_method="component" 부분을 벗어나면 개별 기여도가 모두 반환됩니다.

> VaR(edhec, p=.95, method="historical") 

결과 :

Convertible Arbitrage CTA Global Distressed Securities Emerging Markets 
VaR    -0.01916 -0.0354    -0.018875  -0.044605 
    Equity Market Neutral Event Driven Fixed Income Arbitrage Global Macro 
VaR    -0.006385  -0.02254    -0.00929  -0.01624 
    Long/Short Equity Merger Arbitrage Relative Value Short Selling Funds of Funds 
VaR   -0.02544  -0.013455  -0.013175  -0.07848  -0.021265 

즉 왜 일반적으로 패키지 또는 VaR를 잘 알고 아니에요, 나는이 확실하지 않다지만.

help(VaR)이 동작에 명시 적으로 표시됩니다. 어쨌든 나의 훈련받지 않은 눈에는 아닙니다.

+0

구성 요소 VaR이 정상 VaR이 아닙니다. 따라서이 매개 변수를 벗어날 수 없습니다. –

관련 문제