Hi Jeff,
Thank you for your assistance. Below is my configuration before updating from
R-Forge. After updating xts from R-Forge with
> install.packages("xts", repos="http://R-Forge.R-project.org")
I restart R and it tells me that xts was built under R 2.12.2 which I don't
have. I've updated to the latest 2.12.1 but can't seem to find an xts
repository between the cutting edge R-Forge and the older CRAN.
Thank you for posting the update on CRAN. If you could shoot me a quick email
letting me know when you might be able to do it I'd appreciate. My project
requires the marginal VaR calculation. Thanks.
Henry
> sessionInfo()
R version 2.12.0 (2010-10-15)
Platform: i386-apple-darwin9.8.0/i386 (32-bit)
locale:
[1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] PerformanceAnalytics_1.0.3.2 xts_0.7-5 zoo_1.6-4
loaded via a namespace (and not attached):
[1] grid_2.12.0 lattice_0.19-13 tools_2.12.0
> install.packages("xts", repos="http://R-Forge.R-project.org")
trying URL
'http://R-Forge.R-project.org/bin/macosx/leopard/contrib/2.12/xts_0.7-6.17.tgz'
Content type 'application/x-gzip' length 531338 bytes (518 Kb)
opened URL
==================================================
downloaded 518 Kb
The downloaded packages are in
/var/folders/J2/J25yATorFriawVUQyHOGvU+++TI/-Tmp-//RtmpTWDCru/downloaded_packages
On Feb 22, 2011, at 8:24 AM, Jeffrey Ryan wrote:
> Hi Henry,
>
> I think you have an issue with xts (you didn't include your info). The
> version from R-forge (xts) works fine, but the CRAN version of xts seems to
> cause an issue.
>
> I'll figure out what minimal version of xts you need for PA, and make sure
> that is available on CRAN (as well as have Brian/Peter update the
> requirements for PA)
>
> Best,
> Jeff
>
>
>
> On Tue, Feb 22, 2011 at 10:17 AM, Henry Ward <[email protected]> wrote:
> Hi everyone (& Brian),
>
> I have been using the excellent package PerformanceAnalytics with success.
> Yesterday I tried computing component and marginal VaR with the package on my
> data and I get an error with marginal VaR. Component VaR is fine but
> marginal VaR fails with either the default even-weights or when I pass in a
> weight vector. Below is a simple recreation of the error with EDHEC dataset.
>
> Can somebody help with the marginal VaR calculation? Thanks!
>
> Henry
>
>
> > data(edhec)
> > VaR(edhec)
> Convertible Arbitrage CTA Global Distressed Securities Emerging Markets
> Equity Market Neutral Event Driven
> VaR -0.03247395 -0.03380228 -0.02749240 -0.06363081
> -0.01134637 -0.02812515
> Fixed Income Arbitrage Global Macro Long/Short Equity Merger Arbitrage
> Relative Value Short Selling
> VaR -0.0246791 -0.01548247 -0.03037494 -0.01486869
> -0.01926435 -0.07431463
> Funds of Funds
> VaR -0.02502852
> > VaR(edhec, portfolio_method='component')
> no weights passed in, assuming equal weighted portfolio
> $MVaR
> [,1]
> [1,] 0.01459739
>
> $contribution
> Convertible Arbitrage CTA Global Distressed Securities
> Emerging Markets
> 2.167008e-03 -9.876816e-05 1.720857e-03
> 3.691141e-03
> Equity Market Neutral Event Driven Fixed Income Arbitrage
> Global Macro
> 4.935426e-04 1.780578e-03 1.486652e-03
> 9.209540e-04
> Long/Short Equity Merger Arbitrage Relative Value
> Short Selling
> 1.784986e-03 6.778369e-04 1.324299e-03
> -3.150584e-03
> Funds of Funds
> 1.798890e-03
>
> $pct_contrib_MVaR
> Convertible Arbitrage CTA Global Distressed Securities
> Emerging Markets
> 0.148451703 -0.006766151 0.117887954
> 0.252863009
> Equity Market Neutral Event Driven Fixed Income Arbitrage
> Global Macro
> 0.033810326 0.121979204 0.101843703
> 0.063090308
> Long/Short Equity Merger Arbitrage Relative Value
> Short Selling
> 0.122281163 0.046435481 0.090721618
> -0.215831957
> Funds of Funds
> 0.123233638
>
> > VaR(edhec, portfolio_method='marginal')
> no weights passed in, assuming equal weighted portfolio
> Error in `[.xts`(R, , names(weights)) : 'i' or 'j' out of range
> >
>
>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> [email protected] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions
> should go.
>
>
>
> --
> Jeffrey Ryan
> [email protected]
>
> www.lemnica.com
>
[[alternative HTML version deleted]]
_______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should
go.