[Returnanalytics-commits] r3380 - in pkg/PortfolioAnalytics/sandbox/RFinance2014: . R data figures optimization_results
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu May 1 08:00:59 CEST 2014
Author: rossbennett34
Date: 2014-05-01 08:00:59 +0200 (Thu, 01 May 2014)
New Revision: 3380
Added:
pkg/PortfolioAnalytics/sandbox/RFinance2014/R/
pkg/PortfolioAnalytics/sandbox/RFinance2014/R/charting.R
pkg/PortfolioAnalytics/sandbox/RFinance2014/R/lwShrink.R
pkg/PortfolioAnalytics/sandbox/RFinance2014/README.md
pkg/PortfolioAnalytics/sandbox/RFinance2014/data/
pkg/PortfolioAnalytics/sandbox/RFinance2014/data/crsp_weekly.rda
pkg/PortfolioAnalytics/sandbox/RFinance2014/data/edhec.csv
pkg/PortfolioAnalytics/sandbox/RFinance2014/data/edhec.rda
pkg/PortfolioAnalytics/sandbox/RFinance2014/data/parse_edhec.R
pkg/PortfolioAnalytics/sandbox/RFinance2014/data_analysis.R
pkg/PortfolioAnalytics/sandbox/RFinance2014/data_prep.R
pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/
pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/bt_rb3.rda
pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/bt_w3.rda
pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/crra_RR_ES.png
pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/crra_RR_StdDev.png
pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/directional_barvar.png
pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/edhec_box.png
pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/eqrb_minES.png
pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/equity_box.png
pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/fev_plot.png
pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/opt_dn.png
pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/opt_minES.png
pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/rb_minES.png
pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/relative_barvar.png
pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/ret_crra.png
pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/ret_minES.png
pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/ret_minVar.png
pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/risk_minES.png
pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/risk_minESEqRB.png
pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/risk_minESRB.png
pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/rp_plot.png
pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/rp_viz.rda
pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/w1.rda
pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/w2.rda
pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/weights_crra.png
pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/weights_minES.png
pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/weights_minESEqRB.png
pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/weights_minESRB.png
pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/weights_minVarLW.png
pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/weights_minVarSample.png
pkg/PortfolioAnalytics/sandbox/RFinance2014/index.html
pkg/PortfolioAnalytics/sandbox/RFinance2014/makefile
pkg/PortfolioAnalytics/sandbox/RFinance2014/optimization_analysis.R
pkg/PortfolioAnalytics/sandbox/RFinance2014/optimization_results/
pkg/PortfolioAnalytics/sandbox/RFinance2014/optimization_results/bt.opt.crra.rda
pkg/PortfolioAnalytics/sandbox/RFinance2014/optimization_results/bt.opt.minES.rda
pkg/PortfolioAnalytics/sandbox/RFinance2014/optimization_results/opt.crra.rda
pkg/PortfolioAnalytics/sandbox/RFinance2014/optimization_results/opt.dn.rda
pkg/PortfolioAnalytics/sandbox/RFinance2014/optimization_results/opt.minES.rda
pkg/PortfolioAnalytics/sandbox/RFinance2014/optimization_results/opt.minVarLW.rda
pkg/PortfolioAnalytics/sandbox/RFinance2014/optimization_results/opt.minVarSample.rda
pkg/PortfolioAnalytics/sandbox/RFinance2014/optimization_results/rp.rda
pkg/PortfolioAnalytics/sandbox/RFinance2014/optimize.R
pkg/PortfolioAnalytics/sandbox/RFinance2014/presentation.Rmd
pkg/PortfolioAnalytics/sandbox/RFinance2014/slidy_presentation.html
Log:
Checking in files for presentation after reorganization
Added: pkg/PortfolioAnalytics/sandbox/RFinance2014/R/charting.R
===================================================================
--- pkg/PortfolioAnalytics/sandbox/RFinance2014/R/charting.R (rev 0)
+++ pkg/PortfolioAnalytics/sandbox/RFinance2014/R/charting.R 2014-05-01 06:00:59 UTC (rev 3380)
@@ -0,0 +1,99 @@
+nvd3WeightsPlot <- function(object,
+ type=c("stackedAreaChart", "multiBarChart")
+ ){
+ type <- match.arg(type)
+
+ # extract the weights and turn into a data.frame
+ weights <- extractWeights(object)
+ weights.df <- reshape2::melt(
+ data.frame(date=format(index(weights)), weights),
+ id.vars = 1,
+ variable.name = "stock",
+ value.name = "weight"
+ )
+ weights.df$date <- as.Date(weights.df$date)
+
+ # plot
+ n1 <- rCharts::nPlot(
+ weight ~ date,
+ group = "stock",
+ data = weights.df,
+ type = type
+ )
+ n1$xAxis(
+ tickFormat = "#!function(d){
+ return d3.time.format('%b %Y')(new Date(d * 24 * 60 * 60 * 1000))
+ }!#"
+ )
+ n1$yAxis(
+ tickFormat = "#!function(d){
+ return d3.format('0.2%')(d)
+ }!#"
+ )
+ return(n1)
+}
+
+nvd3RiskPlot <- function(object,
+ type=c("stackedAreaChart", "multiBarChart")
+ ){
+ type <- match.arg(type)
+
+ # extract the risk budget pct_contrib and turn into a data.frame
+ tmp <- extractObjectiveMeasures(object)
+ rb <- tmp[,grep("pct_contrib", colnames(tmp))]
+ colnames(rb) <- gsub("^.*\\.", "", colnames(rb))
+ rb.df <- reshape2::melt(
+ data.frame(date=as.Date(format(index(rb))), rb),
+ id.vars = 1,
+ variable.name = "fund",
+ value.name = "risk"
+ )
+
+ # plot
+ n1 <- rCharts::nPlot(
+ risk ~ date,
+ group = "fund",
+ data = rb.df,
+ type = type
+ )
+ n1$xAxis(
+ tickFormat = "#!function(d){
+ return d3.time.format('%b %Y')(new Date(d * 24 * 60 * 60 * 1000))
+ }!#"
+ )
+ n1$yAxis(
+ tickFormat = "#!function(d){
+ return d3.format('0.2%')(d)
+ }!#"
+ )
+ return(n1)
+}
+
+# require(rCharts)
+# weights <- extractWeights(opt.minVarSample)
+# weights.df <- reshape2::melt(
+# data.frame(
+# date=format(index(weights)),
+# weights
+# ),
+# id.vars = 1,
+# variable.name = "stock",
+# value.name = "weight"
+# )
+#
+# d1 <- dPlot(
+# weight ~ date,
+# groups = "stock",
+# data = weights.df,
+# type = "bubble" #area, bar, or bubble
+# )
+# d1$xAxis(
+# type = "addTimeAxis",
+# inputFormat = "%Y-%m-%d",
+# outputFormat = "%b %Y"
+# )
+# d1$yAxis(
+# outputFormat = "0.2%",
+# orderBy = "weight"
+# )
+# d1
\ No newline at end of file
Added: pkg/PortfolioAnalytics/sandbox/RFinance2014/R/lwShrink.R
===================================================================
--- pkg/PortfolioAnalytics/sandbox/RFinance2014/R/lwShrink.R (rev 0)
+++ pkg/PortfolioAnalytics/sandbox/RFinance2014/R/lwShrink.R 2014-05-01 06:00:59 UTC (rev 3380)
@@ -0,0 +1,54 @@
+lwShrink <- function(x, shrink=NULL){
+ # port of matlab code from http://www.econ.uzh.ch/faculty/wolf/publications.html#9
+ # Ledoit, O. and Wolf, M. (2004).
+ # Honey, I shrunk the sample covariance matrix.
+ # Journal of Portfolio Management 30, Volume 4, 110-119.
+
+ # De-mean returns
+ n <- nrow(x)
+ p <- ncol(x)
+ meanx <- colMeans(x)
+ x <- x - matrix(rep(meanx, n), ncol=p, byrow=TRUE)
+
+ # Compute sample covariance matrix using the de-meaned returns
+ sample <- (1 / n) * (t(x) %*% x)
+
+ # Compute prior
+ var <- matrix(diag(sample), ncol=1)
+ sqrtvar <- sqrt(var)
+ tmpMat <- matrix(rep(sqrtvar, p), nrow=p)
+ rBar <- (sum(sum(sample / (tmpMat * t(tmpMat)))) - p) / (p * (p - 1))
+ prior <- rBar * tmpMat * t(tmpMat)
+ diag(prior) <- var
+
+ if(is.null(shrink)){
+ # What is called pi-hat
+ y <- x^2
+ phiMat <- t(y) %*% y / n - 2 * (t(x) %*% x) * sample / n + sample^2
+ phi <- sum(phiMat)
+
+ # What is called rho-hat
+ term1 <- (t(x^3) %*% x) / n
+ help <- t(x) %*% x / n
+ helpDiag <- matrix(diag(help), ncol=1)
+ term2 <- matrix(rep(helpDiag, p), ncol=p, byrow=FALSE) * sample
+ term3 <- help * matrix(rep(var, p), ncol=p, byrow=FALSE)
+ term4 <- matrix(rep(var, p), ncol=p, byrow=FALSE) * sample
+ thetaMat <- term1 - term2 - term3 + term4
+ diag(thetaMat) <- 0
+ rho <- sum(diag(phiMat)) + rBar * sum(sum(((1 / sqrtvar) %*% t(sqrtvar)) * thetaMat))
+
+ # What is called gamma-hat
+ gamma <- norm(sample - prior, "F")^2
+
+ # Compute shrinkage constant
+ kappa <- (phi - rho) / gamma
+ shrinkage <- max(0, min(1, kappa / n))
+ } else {
+ shrinkage <- shrink
+ }
+ # Compute the estimator
+ sigma <- shrinkage * prior + (1 - shrinkage) * sample
+ out <- list(cov=sigma, prior=prior, shrinkage=shrinkage)
+ return(out)
+}
Added: pkg/PortfolioAnalytics/sandbox/RFinance2014/README.md
===================================================================
--- pkg/PortfolioAnalytics/sandbox/RFinance2014/README.md (rev 0)
+++ pkg/PortfolioAnalytics/sandbox/RFinance2014/README.md 2014-05-01 06:00:59 UTC (rev 3380)
@@ -0,0 +1,17 @@
+PortfolioAnalyticsPresentation
+==============================
+
+Repository for exploring ways to develop html presentation for the PortfolioAnalytics package, primarily for RFinance 2014.
+
+This repo has two branches
+* master
+* gh-pages
+
+Only work on the master branch. The gh-pages branch is used to view the generated presentation as index.html.
+
+http://oli.jp/2011/github-pages-workflow/
+you can push your local master branch to the gh-pages branch on GitHub
+
+```
+git push -f origin master:gh-pages
+```
Added: pkg/PortfolioAnalytics/sandbox/RFinance2014/data/crsp_weekly.rda
===================================================================
(Binary files differ)
Property changes on: pkg/PortfolioAnalytics/sandbox/RFinance2014/data/crsp_weekly.rda
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: pkg/PortfolioAnalytics/sandbox/RFinance2014/data/edhec.csv
===================================================================
--- pkg/PortfolioAnalytics/sandbox/RFinance2014/data/edhec.csv (rev 0)
+++ pkg/PortfolioAnalytics/sandbox/RFinance2014/data/edhec.csv 2014-05-01 06:00:59 UTC (rev 3380)
@@ -0,0 +1,206 @@
+date;Convertible Arbitrage;CTA Global;Distressed Securities;Emerging Markets;Equity Market Neutral;Event Driven;Fixed Income Arbitrage;Global Macro;Long/Short Equity;Merger Arbitrage;Relative Value;Short Selling;Funds Of Funds
+31/01/1997;1.19%;3.93%;1.78%;7.91%;1.89%;2.13%;1.91%;5.73%;2.81%;1.50%;1.80%;-1.66%;3.17%
+28/02/1997;1.23%;2.98%;1.22%;5.25%;1.01%;0.84%;1.22%;1.75%;-0.06%;0.34%;1.18%;4.26%;1.06%
+31/03/1997;0.78%;-0.21%;-0.12%;-1.20%;0.16%;-0.23%;1.09%;-1.19%;-0.84%;0.60%;0.10%;7.78%;-0.77%
+30/04/1997;0.86%;-1.70%;0.30%;1.19%;1.19%;-0.05%;1.30%;1.72%;0.84%;-0.01%;1.22%;-1.29%;0.09%
+31/05/1997;1.56%;-0.15%;2.33%;3.15%;1.89%;3.46%;1.18%;1.08%;3.94%;1.97%;1.73%;-7.37%;2.75%
+30/06/1997;2.12%;0.85%;2.17%;5.81%;1.65%;2.58%;1.08%;2.18%;2.23%;2.31%;1.98%;-0.65%;2.25%
+31/07/1997;1.93%;5.91%;2.34%;5.60%;2.47%;3.07%;0.95%;7.38%;4.54%;2.00%;1.81%;-4.29%;4.35%
+31/08/1997;1.34%;-4.73%;1.47%;-0.66%;0.17%;0.71%;0.87%;-1.80%;1.07%;0.79%;1.03%;-0.72%;0.51%
+30/09/1997;1.22%;1.98%;3.50%;2.29%;2.02%;3.29%;1.19%;2.90%;4.29%;1.97%;1.83%;-1.55%;3.34%
+31/10/1997;1.00%;-0.98%;-0.64%;-5.72%;0.95%;0.61%;-0.32%;-1.42%;0.10%;0.94%;0.79%;5.72%;-0.99%
+30/11/1997;0.00%;1.33%;0.54%;-3.78%;0.41%;1.34%;0.53%;1.06%;-0.26%;2.23%;1.11%;2.17%;-0.34%
+31/12/1997;0.68%;2.86%;0.73%;1.60%;0.66%;1.54%;0.79%;2.64%;1.04%;1.58%;0.82%;1.61%;0.89%
+31/01/1998;1.45%;1.04%;0.95%;-4.29%;0.60%;0.55%;-0.26%;-0.50%;0.13%;0.55%;1.32%;0.14%;-0.36%
+28/02/1998;1.46%;-0.65%;2.27%;3.39%;1.35%;2.94%;0.98%;1.28%;3.42%;2.12%;1.30%;1.55%;2.56%
+31/03/1998;1.44%;1.22%;2.52%;3.18%;1.79%;2.63%;1.28%;5.70%;3.36%;1.64%;1.45%;6.37%;3.73%
+30/04/1998;1.26%;-2.96%;1.65%;0.41%;0.67%;1.04%;0.75%;0.34%;1.20%;1.39%;1.45%;6.57%;1.25%
+31/05/1998;0.56%;1.93%;0.06%;-8.25%;0.80%;-0.83%;0.40%;0.95%;-0.87%;-0.09%;0.53%;14.37%;-0.72%
+30/06/1998;-0.06%;0.51%;-0.47%;-4.22%;1.08%;0.02%;-0.80%;1.20%;1.67%;0.72%;0.26%;-0.53%;0.21%
+31/07/1998;0.60%;-0.10%;-0.69%;0.19%;0.12%;-0.37%;1.06%;0.58%;-0.06%;0.07%;0.11%;3.43%;-0.07%
+31/08/1998;-3.19%;6.91%;-8.36%;-19.22%;-1.07%;-8.86%;-1.43%;-2.63%;-5.52%;-5.44%;-3.41%;24.63%;-6.16%
+30/09/1998;-1.96%;4.54%;-2.15%;-3.95%;0.61%;-1.10%;-3.62%;-0.59%;2.06%;0.76%;0.05%;-3.76%;-0.37%
+31/10/1998;-2.14%;0.04%;-0.29%;1.40%;0.52%;0.91%;-8.01%;-2.23%;1.69%;1.59%;-1.40%;-10.77%;-0.02%
+30/11/1998;2.69%;-0.89%;1.64%;4.30%;1.58%;2.44%;0.52%;1.94%;2.91%;2.20%;1.98%;-7.56%;2.20%
+31/12/1998;1.13%;2.21%;1.08%;-0.98%;2.09%;2.19%;1.20%;2.33%;4.08%;2.24%;1.64%;-5.31%;2.22%
+31/01/1999;2.19%;-1.67%;1.81%;-1.20%;1.01%;2.01%;1.58%;0.86%;2.58%;1.12%;1.95%;-6.65%;2.02%
+28/02/1999;0.82%;1.97%;-0.21%;1.02%;0.23%;-0.42%;2.08%;-1.11%;-1.69%;0.36%;0.85%;8.33%;-0.63%
+31/03/1999;1.36%;-0.65%;1.59%;5.85%;0.33%;1.93%;1.60%;0.24%;2.29%;1.33%;1.16%;-1.54%;2.13%
+30/04/1999;2.43%;2.10%;4.18%;6.30%;1.07%;4.29%;1.06%;3.29%;3.12%;2.18%;2.38%;-3.75%;4.00%
+31/05/1999;1.66%;-1.50%;2.07%;0.61%;0.89%;2.15%;0.72%;-0.55%;0.95%;2.10%;1.46%;0.09%;1.19%
+30/06/1999;1.02%;2.34%;2.73%;6.54%;1.68%;2.97%;0.88%;2.14%;3.15%;2.22%;1.48%;-4.12%;2.82%
+31/07/1999;1.01%;-0.51%;0.84%;-0.61%;1.35%;0.96%;0.51%;-0.18%;1.77%;1.47%;1.10%;0.92%;0.88%
+31/08/1999;0.48%;-0.27%;0.20%;-1.47%;0.95%;-0.27%;-0.28%;-0.61%;0.22%;0.50%;0.62%;4.68%;0.28%
+30/09/1999;0.96%;0.64%;-0.41%;-0.69%;0.95%;0.90%;0.92%;-0.02%;1.13%;1.16%;1.05%;4.01%;0.52%
+31/10/1999;0.45%;-3.54%;0.27%;2.88%;0.66%;0.54%;0.87%;0.73%;2.12%;0.96%;0.70%;-1.30%;1.30%
+30/11/1999;1.24%;1.66%;2.20%;6.92%;1.33%;2.84%;1.06%;4.05%;4.81%;2.37%;1.37%;-12.39%;4.83%
+31/12/1999;1.40%;1.42%;3.00%;12.30%;1.98%;2.86%;0.97%;6.12%;7.45%;0.90%;1.83%;-11.37%;6.22%
+31/01/2000;2.27%;1.28%;0.88%;0.77%;0.75%;0.88%;0.41%;0.21%;0.75%;1.43%;1.73%;4.27%;1.69%
+29/02/2000;2.67%;-0.22%;4.21%;5.28%;2.53%;3.46%;0.97%;4.08%;6.99%;2.39%;1.85%;-13.40%;6.66%
+31/03/2000;2.43%;-1.38%;1.03%;3.18%;1.34%;0.69%;-0.61%;-1.04%;0.06%;1.31%;1.63%;-2.30%;0.39%
+30/04/2000;2.23%;-2.41%;-1.01%;-5.41%;1.68%;-0.59%;-0.06%;-3.04%;-2.01%;1.88%;0.92%;10.28%;-2.69%
+31/05/2000;1.49%;1.14%;-1.32%;-4.33%;0.62%;-0.34%;1.07%;-0.70%;-0.97%;1.46%;0.80%;7.04%;-1.22%
+30/06/2000;1.79%;-1.24%;2.03%;3.34%;1.71%;2.68%;0.58%;1.54%;3.49%;1.67%;1.76%;-11.07%;3.11%
+31/07/2000;0.93%;-1.31%;0.64%;0.25%;0.63%;0.57%;0.18%;0.37%;0.06%;1.16%;0.84%;5.53%;-0.22%
+31/08/2000;1.62%;1.89%;1.40%;3.68%;2.10%;1.73%;1.07%;2.48%;3.45%;1.57%;1.57%;-11.35%;2.67%
+30/09/2000;1.41%;-2.08%;-0.19%;-4.62%;0.58%;0.48%;0.76%;-1.49%;-0.16%;1.37%;0.75%;12.04%;-0.69%
+31/10/2000;0.52%;0.75%;-0.73%;-2.56%;0.40%;-0.68%;0.06%;-0.24%;-0.84%;0.26%;-0.04%;7.84%;-1.04%
+30/11/2000;-0.81%;4.25%;-2.09%;-3.85%;0.45%;-1.36%;0.66%;1.25%;-1.53%;1.02%;0.06%;16.57%;-2.05%
+31/12/2000;-0.02%;6.82%;0.01%;1.16%;1.60%;1.27%;0.48%;4.72%;2.48%;1.25%;0.75%;0.63%;1.33%
+31/01/2001;3.44%;0.25%;3.08%;5.86%;0.75%;2.98%;1.63%;2.14%;1.65%;1.11%;3.33%;-2.71%;2.23%
+28/02/2001;1.82%;-0.16%;1.00%;-2.21%;1.20%;0.45%;0.54%;-0.72%;-2.64%;0.54%;0.30%;10.21%;-0.89%
+31/03/2001;1.62%;4.38%;-0.37%;-1.75%;1.08%;-0.42%;0.51%;0.38%;-1.99%;-0.61%;-0.11%;6.20%;-0.68%
+30/04/2001;1.57%;-3.62%;0.48%;1.14%;0.75%;1.10%;0.94%;0.49%;2.46%;0.58%;1.74%;-9.91%;1.04%
+31/05/2001;0.33%;0.81%;2.35%;2.78%;0.77%;1.85%;0.68%;0.32%;0.43%;1.61%;1.41%;-1.30%;0.80%
+30/06/2001;0.12%;-0.77%;3.60%;1.60%;0.17%;0.63%;0.17%;0.17%;0.19%;-0.87%;0.19%;1.10%;0.13%
+31/07/2001;0.91%;-0.40%;0.73%;-2.86%;0.31%;0.49%;0.54%;-0.40%;-1.44%;0.79%;0.10%;3.53%;-0.40%
+31/08/2001;1.42%;1.53%;1.06%;0.30%;0.94%;0.90%;1.05%;0.06%;-0.96%;0.99%;-0.31%;7.52%;0.19%
+30/09/2001;0.78%;2.46%;-0.14%;-4.25%;0.23%;-2.54%;-0.13%;-0.70%;-3.48%;-2.67%;-2.21%;9.41%;-1.42%
+31/10/2001;1.17%;3.36%;1.03%;2.78%;0.58%;1.48%;1.34%;2.08%;0.99%;0.85%;1.64%;-2.98%;0.95%
+30/11/2001;0.80%;-5.43%;0.86%;4.83%;0.55%;1.05%;-0.24%;0.21%;2.00%;0.14%;1.36%;-6.55%;0.58%
+31/12/2001;-0.94%;1.48%;0.15%;4.21%;0.56%;1.07%;0.53%;1.38%;1.80%;0.45%;0.97%;-2.51%;0.99%
+31/01/2002;1.48%;-0.72%;1.86%;2.73%;0.65%;0.78%;0.86%;0.69%;-0.37%;0.77%;0.97%;3.43%;0.30%
+28/02/2002;-0.49%;-2.02%;-0.33%;1.81%;-0.07%;-0.71%;0.56%;-0.35%;-1.23%;-0.44%;-0.11%;3.90%;-0.15%
+31/03/2002;0.53%;0.09%;0.52%;3.31%;0.47%;1.53%;0.45%;0.64%;1.55%;0.73%;1.45%;-4.46%;0.90%
+30/04/2002;0.96%;-1.04%;1.39%;1.44%;0.76%;0.46%;1.13%;0.98%;-0.42%;-0.13%;0.70%;4.83%;0.52%
+31/05/2002;0.33%;2.70%;0.91%;0.01%;0.53%;0.01%;0.99%;1.23%;-0.34%;0.00%;0.31%;3.46%;0.50%
+30/06/2002;0.04%;6.55%;-1.17%;-2.92%;0.22%;-2.83%;0.69%;-0.22%;-2.49%;-1.70%;-1.07%;5.48%;-0.95%
+31/07/2002;-1.59%;4.13%;-1.33%;-3.09%;-0.13%;-3.00%;0.57%;-0.78%;-3.89%;-1.74%;-1.85%;6.44%;-1.40%
+31/08/2002;0.50%;2.20%;0.09%;1.19%;0.69%;0.60%;0.97%;0.63%;0.41%;0.61%;0.58%;0.15%;0.37%
+30/09/2002;1.46%;2.84%;-0.44%;-2.52%;0.15%;-0.70%;-0.33%;0.54%;-1.60%;-0.28%;-1.10%;7.31%;-0.33%
+31/10/2002;1.04%;-3.76%;-0.31%;1.54%;0.16%;0.31%;-0.63%;-0.86%;1.23%;0.32%;0.84%;-4.05%;-0.31%
+30/11/2002;2.51%;-1.64%;2.39%;1.90%;0.25%;2.16%;0.54%;0.47%;2.24%;0.54%;1.85%;-5.47%;1.06%
+31/12/2002;1.57%;4.89%;2.22%;0.48%;0.94%;0.44%;1.53%;1.92%;-1.49%;0.46%;0.23%;4.43%;0.77%
+31/01/2003;2.83%;4.41%;2.43%;0.12%;0.83%;1.54%;1.06%;1.82%;0.05%;0.40%;0.67%;1.62%;0.72%
+28/02/2003;1.33%;4.02%;0.92%;0.84%;0.24%;0.26%;0.79%;1.66%;-0.37%;0.18%;-0.04%;1.30%;0.31%
+31/03/2003;0.89%;-4.45%;1.13%;0.19%;0.15%;0.83%;0.19%;-1.22%;0.20%;-0.07%;0.49%;-0.75%;-0.04%
+30/04/2003;1.50%;0.65%;3.45%;4.50%;0.31%;2.72%;0.91%;1.17%;2.98%;0.99%;1.86%;-6.56%;1.34%
+31/05/2003;1.36%;4.90%;2.70%;4.33%;1.07%;3.01%;2.07%;3.97%;3.62%;1.54%;2.12%;-4.99%;2.05%
+30/06/2003;-0.58%;-1.92%;2.67%;2.68%;0.34%;1.81%;0.44%;0.56%;1.28%;0.48%;0.71%;-1.62%;0.68%
+31/07/2003;-0.72%;-1.71%;1.17%;1.04%;-0.06%;1.19%;-0.92%;-0.35%;1.18%;0.53%;0.41%;-3.61%;0.25%
+31/08/2003;-0.87%;0.78%;1.37%;3.74%;0.31%;1.33%;0.43%;2.02%;1.79%;0.70%;0.58%;-3.54%;0.78%
+30/09/2003;1.71%;-0.19%;2.42%;2.64%;0.78%;1.33%;1.05%;2.15%;0.94%;0.77%;0.86%;1.36%;1.21%
+31/10/2003;1.46%;1.04%;2.67%;2.59%;1.15%;1.91%;0.35%;1.11%;2.99%;1.11%;1.59%;-6.56%;1.52%
+30/11/2003;0.92%;0.18%;1.54%;0.96%;0.46%;1.16%;0.69%;0.31%;1.30%;0.44%;1.02%;-1.36%;0.70%
+31/12/2003;0.54%;3.81%;1.98%;4.03%;0.54%;1.72%;1.01%;2.93%;1.91%;0.98%;1.27%;-1.78%;1.39%
+31/01/2004;1.19%;1.99%;3.01%;2.51%;1.09%;2.34%;0.92%;1.17%;1.92%;0.97%;1.46%;-0.90%;1.56%
+29/02/2004;0.17%;5.29%;0.75%;2.53%;0.63%;1.13%;0.84%;1.50%;1.23%;0.51%;0.57%;0.18%;1.11%
+31/03/2004;0.61%;-0.51%;0.46%;1.72%;0.32%;0.16%;0.03%;0.64%;0.41%;0.17%;0.38%;-1.48%;0.43%
+30/04/2004;0.20%;-5.32%;0.93%;-2.52%;-0.82%;0.02%;0.62%;-1.78%;-1.65%;-0.39%;-0.45%;3.84%;-0.68%
+31/05/2004;-1.28%;-1.18%;-0.10%;-1.81%;0.24%;-0.23%;0.40%;-0.81%;-0.35%;0.00%;-0.37%;-0.24%;-0.82%
+30/06/2004;-1.06%;-3.16%;2.02%;0.20%;0.42%;1.13%;0.55%;-0.19%;0.91%;0.17%;0.22%;-0.51%;0.34%
+31/07/2004;0.13%;-1.19%;0.19%;-0.27%;0.06%;-0.82%;0.62%;-0.14%;-1.54%;-0.92%;0.07%;6.38%;-0.49%
+31/08/2004;0.40%;-0.84%;0.88%;1.33%;-0.09%;0.35%;0.36%;-0.39%;-0.22%;0.11%;0.31%;1.26%;-0.10%
+30/09/2004;-0.17%;2.20%;1.04%;2.80%;0.85%;1.03%;0.12%;0.08%;2.10%;0.42%;0.52%;-2.16%;0.99%
+31/10/2004;-0.44%;3.58%;1.43%;1.85%;-0.05%;1.24%;0.28%;1.38%;0.74%;0.74%;0.40%;-0.92%;0.68%
+30/11/2004;0.81%;4.75%;3.37%;3.28%;1.40%;3.06%;0.75%;2.80%;3.08%;1.64%;1.49%;-5.74%;2.44%
+31/12/2004;0.56%;0.00%;2.66%;2.01%;0.58%;2.44%;0.60%;0.33%;1.78%;1.33%;0.99%;-3.91%;1.45%
+31/01/2005;-0.96%;-4.38%;0.37%;1.43%;0.81%;0.04%;0.44%;-0.47%;-0.17%;0.00%;0.12%;3.87%;0.06%
+28/02/2005;-0.58%;0.05%;1.34%;3.46%;0.80%;1.44%;0.85%;1.71%;2.10%;0.65%;0.81%;1.18%;1.36%
+31/03/2005;-1.40%;-0.06%;0.32%;-1.97%;0.19%;-0.04%;0.24%;-0.27%;-0.96%;0.32%;-0.42%;2.44%;-0.44%
+30/04/2005;-3.16%;-3.54%;-0.52%;-0.49%;-0.30%;-1.28%;-0.03%;-0.80%;-1.84%;-1.05%;-1.08%;3.93%;-1.41%
+31/05/2005;-1.33%;2.32%;0.06%;0.72%;0.47%;0.65%;-0.10%;0.88%;1.15%;0.95%;-0.02%;-4.75%;0.18%
+30/06/2005;1.07%;2.60%;1.33%;1.60%;0.81%;1.33%;0.10%;1.16%;1.95%;0.85%;0.95%;-0.32%;1.31%
+31/07/2005;1.64%;-0.13%;1.73%;2.57%;0.78%;2.15%;0.81%;1.19%;2.65%;1.15%;1.49%;-2.42%;1.34%
+31/08/2005;0.66%;1.00%;1.24%;1.52%;0.62%;0.92%;0.36%;0.83%;0.97%;0.61%;0.53%;2.59%;0.79%
+30/09/2005;1.42%;0.79%;1.12%;4.02%;0.87%;1.00%;0.62%;2.69%;2.22%;0.35%;1.22%;1.98%;1.47%
+31/10/2005;-0.15%;-0.92%;-0.32%;-2.30%;0.01%;-1.73%;0.57%;-0.74%;-1.74%;-1.45%;-0.38%;2.33%;-1.49%
+30/11/2005;0.04%;3.79%;1.00%;2.79%;0.61%;1.25%;0.15%;1.64%;2.11%;1.12%;0.67%;-3.00%;1.60%
+31/12/2005;0.92%;-1.53%;1.22%;2.84%;0.68%;1.42%;0.54%;1.35%;2.49%;1.38%;1.26%;-0.35%;1.91%
+31/01/2006;2.50%;1.74%;2.53%;5.26%;1.15%;3.41%;0.93%;2.58%;3.81%;2.72%;2.38%;-2.88%;2.86%
+28/02/2006;1.16%;-1.86%;0.65%;1.61%;0.46%;0.51%;0.41%;0.02%;0.16%;1.04%;0.73%;0.64%;0.37%
+31/03/2006;1.07%;2.84%;1.72%;1.22%;0.98%;1.85%;0.55%;0.94%;2.38%;1.44%;1.57%;-1.39%;1.64%
+30/04/2006;0.64%;3.87%;1.93%;3.65%;1.02%;1.64%;1.21%;2.38%;1.72%;1.19%;1.26%;-0.12%;1.71%
+31/05/2006;0.91%;-1.46%;0.86%;-3.89%;0.02%;0.08%;0.59%;-1.55%;-2.48%;0.09%;-0.25%;2.46%;-1.33%
+30/06/2006;0.12%;-1.42%;-0.15%;-0.97%;0.63%;0.12%;0.36%;-0.15%;-0.62%;0.87%;0.21%;1.18%;-0.28%
+31/07/2006;0.66%;-2.16%;0.09%;0.67%;0.51%;-0.11%;0.64%;0.06%;-0.31%;0.58%;0.17%;1.73%;-0.05%
+31/08/2006;0.98%;0.20%;0.99%;1.33%;-0.09%;1.12%;0.37%;-0.39%;1.14%;0.53%;0.92%;-1.56%;0.66%
+30/09/2006;0.93%;-0.55%;0.33%;0.11%;0.09%;0.35%;0.14%;-0.67%;0.05%;0.41%;0.40%;-2.36%;-0.03%
+31/10/2006;0.54%;1.02%;1.94%;2.57%;0.65%;2.06%;0.67%;0.97%;1.94%;1.32%;1.32%;-3.80%;1.63%
+30/11/2006;0.92%;2.26%;1.79%;3.23%;0.75%;1.82%;0.60%;1.99%;2.00%;1.42%;1.29%;-2.68%;1.85%
+31/12/2006;1.27%;1.46%;1.65%;2.91%;1.07%;1.68%;0.72%;1.16%;1.53%;1.33%;1.28%;0.39%;1.75%
+31/01/2007;1.30%;1.13%;1.50%;0.79%;0.83%;2.01%;0.69%;0.61%;1.21%;1.91%;1.35%;-1.07%;1.21%
+28/02/2007;1.17%;-1.44%;1.45%;1.00%;0.51%;2.07%;1.06%;0.18%;0.82%;2.55%;1.14%;0.28%;0.96%
+31/03/2007;0.60%;-1.41%;1.08%;1.85%;1.01%;1.46%;0.60%;0.27%;1.15%;0.63%;0.81%;-0.51%;0.96%
+30/04/2007;0.26%;2.41%;1.64%;2.55%;0.89%;1.97%;0.71%;1.52%;1.98%;1.60%;1.34%;-2.65%;1.63%
+31/05/2007;1.10%;2.30%;1.80%;2.70%;1.21%;2.13%;0.55%;1.92%;2.24%;1.71%;1.56%;-1.99%;2.04%
+30/06/2007;0.11%;2.29%;0.27%;2.36%;0.77%;-0.07%;0.48%;1.07%;0.77%;-0.53%;1.00%;2.36%;0.82%
+31/07/2007;-0.53%;-1.22%;-0.56%;2.75%;0.51%;-0.32%;0.07%;1.16%;0.09%;-0.54%;0.04%;4.86%;0.41%
+31/08/2007;-1.45%;-2.80%;-1.18%;-2.74%;-0.94%;-1.44%;-0.48%;-1.16%;-1.60%;0.01%;-0.77%;0.92%;-2.22%
+30/09/2007;1.61%;4.69%;0.95%;4.28%;1.23%;1.34%;1.64%;3.30%;2.56%;1.31%;1.53%;-2.07%;1.99%
+31/10/2007;1.77%;2.80%;1.75%;4.85%;1.68%;2.14%;1.14%;3.04%;2.81%;1.91%;2.00%;-0.26%;3.03%
+30/11/2007;-1.31%;-0.16%;-1.69%;-2.37%;-0.18%;-2.02%;-0.94%;-0.63%;-2.25%;-1.49%;-1.12%;7.19%;-1.48%
+31/12/2007;-0.77%;1.17%;0.02%;1.30%;0.54%;0.07%;0.36%;1.04%;0.43%;-0.25%;0.22%;0.56%;0.40%
+31/01/2008;-0.09%;2.55%;-2.33%;-5.03%;-1.12%;-2.71%;-0.12%;-0.10%;-4.00%;-1.26%;-1.18%;5.56%;-2.72%
+29/02/2008;-0.83%;6.20%;0.14%;2.80%;1.20%;0.84%;-0.49%;3.12%;1.40%;0.60%;0.64%;3.00%;1.42%
+31/03/2008;-3.17%;-0.56%;-1.26%;-3.79%;-0.49%;-1.68%;-3.06%;-1.69%;-2.36%;-0.45%;-1.62%;1.92%;-2.62%
+30/04/2008;0.76%;-0.78%;0.88%;1.90%;0.59%;1.18%;1.87%;0.78%;2.23%;1.49%;1.30%;-4.61%;0.97%
+31/05/2008;1.07%;1.62%;1.37%;1.63%;1.26%;1.76%;1.03%;1.14%;2.27%;1.36%;1.59%;-1.42%;1.72%
+30/06/2008;-0.81%;3.30%;-0.31%;-2.74%;1.56%;-1.13%;-0.27%;0.30%;-1.64%;-1.09%;-0.84%;7.51%;-0.68%
+31/07/2008;-1.88%;-3.33%;-1.82%;-3.30%;-1.00%;-1.66%;-0.23%;-2.13%;-2.61%;0.11%;-1.25%;0.72%;-2.64%
+31/08/2008;-0.66%;-1.14%;-0.72%;-3.36%;-1.35%;-0.25%;-0.03%;-1.33%;-1.46%;0.51%;-0.23%;-2.15%;-1.56%
+30/09/2008;-10.27%;0.10%;-5.18%;-9.82%;-2.85%;-6.27%;-5.06%;-3.13%;-6.75%;-2.76%;-5.38%;3.78%;-6.18%
+31/10/2008;-12.37%;3.45%;-7.75%;-13.31%;-0.44%;-6.25%;-8.67%;-1.57%;-6.29%;-2.45%;-6.92%;11.70%;-6.00%
+30/11/2008;-2.76%;2.14%;-4.35%;-3.91%;-5.87%;-3.01%;-3.08%;0.33%;-1.88%;0.06%;-2.09%;4.28%;-1.92%
+31/12/2008;1.77%;1.40%;-1.97%;-0.10%;0.05%;-0.71%;-0.35%;1.18%;0.81%;1.62%;0.31%;-1.46%;-1.19%
+31/01/2009;4.91%;-0.16%;0.82%;-1.12%;0.79%;1.32%;1.12%;0.29%;-0.17%;0.56%;1.00%;2.82%;0.60%
+28/02/2009;1.64%;-0.31%;-1.22%;-1.33%;-0.46%;-0.91%;0.65%;-0.55%;-1.61%;0.06%;-0.16%;3.28%;-0.37%
+31/03/2009;2.35%;-1.80%;0.22%;3.50%;0.21%;1.17%;0.57%;0.48%;1.88%;1.25%;1.00%;-4.62%;0.08%
+30/04/2009;5.00%;-1.40%;3.87%;6.63%;-0.12%;3.37%;2.21%;1.27%;3.75%;0.81%;3.42%;-8.20%;0.92%
+31/05/2009;5.78%;2.13%;5.04%;8.84%;1.46%;4.42%;3.65%;3.48%;5.16%;1.07%;3.92%;0.08%;3.12%
+30/06/2009;2.41%;-1.47%;1.98%;0.13%;0.36%;1.23%;1.26%;-0.76%;0.09%;1.04%;1.01%;-0.94%;0.24%
+31/07/2009;6.11%;-0.12%;3.11%;4.51%;0.42%;2.91%;3.22%;1.66%;2.77%;0.68%;2.60%;-5.96%;1.53%
+31/08/2009;3.15%;0.54%;2.44%;1.66%;0.70%;2.07%;2.02%;0.50%;1.57%;1.02%;1.62%;-1.65%;1.13%
+30/09/2009;3.68%;1.51%;4.10%;5.36%;0.85%;3.36%;3.25%;2.31%;2.85%;1.10%;2.20%;-3.94%;1.71%
+31/10/2009;1.19%;-1.47%;1.39%;1.08%;-0.05%;0.43%;1.85%;-0.04%;-0.86%;0.26%;0.32%;3.14%;-0.21%
+30/11/2009;0.80%;3.32%;2.02%;1.51%;0.09%;1.52%;0.96%;1.65%;1.30%;0.68%;0.89%;-2.27%;0.82%
+31/12/2009;2.15%;-2.53%;3.24%;2.29%;0.72%;2.35%;1.41%;-0.28%;1.86%;1.02%;1.61%;-3.73%;0.66%
+31/01/2010;0.53%;-2.78%;1.87%;-0.78%;0.28%;0.77%;1.72%;-0.84%;-0.95%;0.48%;0.60%;1.83%;-0.36%
+28/02/2010;0.36%;0.90%;0.31%;-0.19%;0.50%;0.76%;0.23%;0.47%;0.84%;0.57%;0.57%;-2.61%;0.13%
+31/03/2010;2.29%;2.75%;3.36%;4.21%;0.77%;2.73%;1.36%;1.71%;2.87%;1.09%;1.79%;-4.96%;1.71%
+30/04/2010;1.99%;1.00%;2.51%;1.33%;0.18%;1.64%;1.13%;0.76%;1.00%;0.38%;1.22%;-2.87%;0.85%
+31/05/2010;-2.44%;-2.48%;-2.50%;-4.80%;-0.50%;-2.57%;-1.02%;-1.28%;-3.71%;-1.15%;-1.86%;4.45%;-2.72%
+30/06/2010;0.17%;0.11%;-1.05%;-0.39%;-0.45%;-1.06%;0.78%;-0.23%;-1.61%;0.23%;-0.34%;4.19%;-0.79%
+31/07/2010;2.27%;-0.80%;1.43%;2.96%;0.90%;1.70%;1.00%;0.33%;1.91%;1.27%;1.74%;-4.26%;0.69%
+31/08/2010;1.21%;3.10%;-0.49%;0.28%;-0.44%;-0.32%;0.88%;1.08%;-0.96%;0.70%;0.31%;3.89%;0.06%
+30/09/2010;1.89%;2.67%;2.17%;4.29%;1.60%;2.72%;1.32%;2.63%;4.08%;1.34%;2.15%;-8.26%;2.19%
+31/10/2010;2.14%;3.11%;2.06%;2.32%;1.05%;1.87%;1.07%;1.59%;2.08%;0.47%;1.49%;-1.79%;1.48%
+30/11/2010;-0.12%;-2.24%;0.65%;-0.49%;0.44%;0.28%;0.56%;-0.47%;0.66%;-0.25%;0.37%;-1.62%;-0.09%
+31/12/2010;1.45%;4.36%;3.11%;2.26%;0.94%;2.60%;0.55%;2.50%;3.42%;1.16%;1.57%;-5.07%;2.05%
+31/01/2011;1.81%;-0.63%;1.73%;-0.65%;0.56%;1.41%;1.81%;-0.55%;0.52%;0.93%;0.97%;-0.76%;0.13%
+28/02/2011;1.62%;1.77%;1.44%;0.11%;0.59%;1.29%;1.03%;0.95%;1.39%;0.62%;1.12%;-3.14%;0.83%
+31/03/2011;0.38%;-1.64%;0.43%;1.54%;0.80%;0.20%;0.22%;-0.28%;0.21%;0.31%;0.34%;-1.70%;-0.18%
+30/04/2011;0.20%;3.67%;1.29%;1.40%;1.05%;1.14%;0.97%;2.11%;1.39%;0.89%;0.72%;-1.97%;1.14%
+31/05/2011;-0.17%;-3.39%;-0.14%;-1.91%;-0.37%;-0.52%;0.33%;-1.50%;-1.08%;-0.11%;-0.05%;1.34%;-1.16%
+30/06/2011;-0.91%;-2.39%;-0.68%;-1.00%;-0.14%;-1.38%;-0.10%;-1.30%;-1.17%;-0.14%;-0.56%;2.70%;-1.38%
+31/07/2011;-0.33%;2.58%;-0.15%;0.77%;-0.03%;-0.30%;0.18%;1.29%;-0.30%;-0.49%;-0.06%;1.99%;0.34%
+31/08/2011;-1.95%;0.07%;-4.02%;-3.90%;-1.61%;-4.01%;-0.85%;-0.63%;-4.21%;-1.19%;-2.00%;6.69%;-2.52%
+30/09/2011;-1.90%;-0.57%;-3.70%;-6.95%;-1.59%;-3.41%;-0.48%;-1.42%;-4.61%;-1.02%;-1.97%;7.77%;-2.62%
+31/10/2011;1.29%;-3.17%;2.37%;3.65%;1.61%;2.98%;0.63%;0.53%;3.90%;1.72%;1.47%;-7.21%;0.94%
+30/11/2011;-0.94%;0.14%;-1.08%;-2.72%;0.02%;-0.58%;-0.34%;-0.66%;-1.31%;0.17%;-0.24%;1.31%;-0.93%
+31/12/2011;0.29%;0.34%;0.50%;-1.81%;0.06%;-0.34%;0.45%;-0.22%;-0.56%;0.56%;0.12%;0.41%;-0.54%
+31/01/2012;2.36%;0.46%;3.24%;3.95%;0.95%;2.88%;1.16%;1.90%;3.27%;0.95%;2.02%;-6.79%;1.47%
+29/02/2012;2.18%;0.91%;2.02%;3.41%;0.71%;1.70%;1.19%;1.34%;2.48%;1.11%;1.72%;-5.22%;1.40%
+31/03/2012;0.65%;-2.04%;0.91%;-1.33%;0.23%;0.58%;0.61%;-0.61%;0.33%;0.24%;0.55%;-1.23%;0.01%
+30/04/2012;-0.17%;-0.03%;-0.12%;-0.27%;-0.13%;-0.18%;0.34%;-0.59%;-0.68%;-0.11%;-0.20%;0.57%;-0.33%
+31/05/2012;-0.77%;2.59%;-1.86%;-5.31%;-1.15%;-1.91%;-0.03%;-0.67%;-3.75%;-0.48%;-1.00%;6.77%;-1.40%
+30/06/2012;0.72%;-2.72%;-0.09%;0.26%;0.06%;0.07%;0.46%;-0.63%;0.60%;0.23%;0.70%;-2.58%;-0.37%
+31/07/2012;0.92%;3.12%;0.89%;0.81%;0.41%;0.48%;1.25%;1.44%;0.39%;0.06%;1.17%;0.87%;0.76%
+31/08/2012;0.76%;-0.82%;1.61%;0.75%;0.49%;1.29%;0.82%;0.37%;1.08%;0.44%;0.95%;-3.67%;0.68%
+30/09/2012;0.57%;-1.04%;1.69%;2.73%;0.43%;1.20%;0.76%;0.51%;1.57%;0.06%;1.02%;-3.85%;0.73%
+31/10/2012;0.17%;-3.10%;1.18%;0.28%;0.28%;0.48%;0.58%;-0.83%;0.09%;-0.79%;0.30%;0.05%;-0.25%
+30/11/2012;0.41%;-0.04%;0.82%;1.31%;0.37%;0.80%;0.54%;0.27%;0.52%;1.00%;0.56%;-1.50%;0.46%
+31/12/2012;0.98%;0.57%;2.59%;3.30%;0.37%;1.93%;0.73%;1.11%;1.45%;1.45%;1.17%;-3.87%;1.08%
+31/01/2013;1.58%;1.86%;2.19%;3.03%;1.35%;2.14%;1.16%;1.65%;3.08%;-0.16%;2.04%;-4.52%;2.06%
+28/02/2013;0.09%;-0.99%;0.52%;-0.12%;0.33%;0.41%;0.56%;-0.12%;0.37%;0.39%;0.47%;-0.35%;0.32%
+31/03/2013;0.77%;0.89%;1.49%;0.68%;0.35%;1.43%;1.13%;0.64%;1.44%;0.69%;1.30%;-1.89%;0.93%
+30/04/2013;0.52%;1.92%;1.75%;0.63%;0.08%;0.78%;0.50%;1.14%;0.64%;0.61%;0.55%;-2.86%;0.76%
+31/05/2013;1.34%;-2.61%;2.23%;0.33%;0.24%;1.87%;0.50%;-0.23%;1.35%;0.59%;1.01%;-2.45%;0.67%
+30/06/2013;-0.81%;-2.73%;-1.05%;-3.21%;0.28%;-1.13%;-1.22%;-1.76%;-0.94%;-0.22%;-1.02%;0.56%;-1.33%
+31/07/2013;0.60%;-0.76%;1.40%;0.75%;1.00%;1.49%;0.67%;0.16%;2.15%;1.03%;1.17%;-3.69%;0.91%
+31/08/2013;0.46%;-1.39%;-0.34%;-1.22%;-0.59%;-0.11%;0.14%;-0.91%;-0.76%;-0.01%;-0.46%;1.07%;-0.68%
+30/09/2013;0.43%;-0.57%;1.64%;2.35%;0.63%;1.60%;0.47%;0.69%;2.33%;0.84%;1.40%;-4.52%;1.27%
+31/10/2013;0.95%;1.45%;1.61%;2.38%;1.42%;1.45%;0.85%;0.94%;2.04%;0.45%;1.45%;-2.07%;1.25%
+30/11/2013;0.07%;1.14%;1.22%;0.30%;1.05%;1.19%;0.67%;0.69%;1.54%;0.30%;0.87%;-1.65%;1.09%
+31/12/2013;0.48%;0.52%;1.20%;1.01%;0.76%;1.22%;0.40%;0.65%;1.57%;0.61%;1.02%;-1.55%;1.09%
+31/01/2014;1.37%;-1.75%;0.47%;-1.95%;0.42%;0.30%;0.75%;-0.88%;-0.32%;0.46%;0.02%;0.94%;-0.33%
\ No newline at end of file
Added: pkg/PortfolioAnalytics/sandbox/RFinance2014/data/edhec.rda
===================================================================
(Binary files differ)
Property changes on: pkg/PortfolioAnalytics/sandbox/RFinance2014/data/edhec.rda
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: pkg/PortfolioAnalytics/sandbox/RFinance2014/data/parse_edhec.R
===================================================================
--- pkg/PortfolioAnalytics/sandbox/RFinance2014/data/parse_edhec.R (rev 0)
+++ pkg/PortfolioAnalytics/sandbox/RFinance2014/data/parse_edhec.R 2014-05-01 06:00:59 UTC (rev 3380)
@@ -0,0 +1,11 @@
+library(xts)
+
+df <- read.table("data/edhec.csv", header=TRUE, as.is=TRUE, sep=";")
+head(df)
+
+edhec <- xts(apply(df[,-1], 2, function(x) as.numeric(gsub("%", "", x))) / 100, as.Date(df[,1], format="%d/%m/%Y"))
+save(edhec, file="edhec.rda")
+# load("edhec.rda")
+# head(edhec)
+# library(PerformanceAnalytics)
+# data(edhec)
Added: pkg/PortfolioAnalytics/sandbox/RFinance2014/data_analysis.R
===================================================================
--- pkg/PortfolioAnalytics/sandbox/RFinance2014/data_analysis.R (rev 0)
+++ pkg/PortfolioAnalytics/sandbox/RFinance2014/data_analysis.R 2014-05-01 06:00:59 UTC (rev 3380)
@@ -0,0 +1,127 @@
+library(PerformanceAnalytics)
+
+source("data_prep.R")
+
+figures.dir <- "figures"
+
+##### Equity Data for Example 1 and Example 2 #####
+colors <- c(rep("blue", 15), rep("green", 15), rep("red", 5))
+sd.order <- order(StdDev(equity.data))
+
+# boxplot to compare return distributions
+# mar(bottom, left, top, right)
+# default: par(mar=c(5, 4, 4, 2) + 0.1)
+png(paste(figures.dir, "equity_box.png", sep="/"), height = 500, width = 1000)
+boxplot(coredata(equity.data[,sd.order]),
+ cex.axis=0.8, las=3, ylab="Returns", pch=18,
+ col=colors[sd.order],
+ main="Return Distribution\n(sorted by StdDev)")
+legend("topleft", legend=c("Large Cap", "Mid Cap", "Small Cap"),
+ fill=c("blue", "green", "red"), bty="n", cex=0.8)
+dev.off()
+
+##### edhec Data for Example 3 and Example 4 #####
+p <- 0.95
+
+png(paste(figures.dir, "relative_barvar.png", sep="/"))
+charts.BarVaR(R[,1:3], width=60, methods=c("ModifiedES", "ModifiedVaR"),
+ main="Relative Value")
+dev.off()
+
+png(paste(figures.dir, "directional_barvar.png", sep="/"))
+charts.BarVaR(R[,4:6], width=60, methods=c("ModifiedES", "ModifiedVaR"),
+ main="Directional")
+dev.off()
+
+
+colors <- c(rep("lightblue", 3), rep("red", 3))
+ES.order <- order(ES(R, p=p, invert=FALSE))
+
+png(paste(figures.dir, "edhec_box.png", sep="/"), height = 500, width = 1000)
+boxplot(coredata(R[,ES.order]),
+ cex.axis=0.8, las=3, ylab="Returns", pch=18,
+ col=colors[ES.order],
+ main="Return Distribution\n(sorted by Modified ES (95%))")
+legend("topleft", legend=c("Relative Value", "Directional"),
+ fill=c("lightblue", "red"), bty="n", cex=0.8)
+dev.off()
+
+# script for data analysis
+
+# library(PerformanceAnalytics)
+# library(lattice)
+# library(corrplot)
+
+# load("data/edhec.rda")
+#
+# head(edhec)
+# R <- edhec[,1:4]
+# p <- 0.95
+#
+# first(R)
+# last(R)
+
+# plot the timeseries of returns
+# plot(as.zoo(edhec))
+# xyplot(R, scales=list(y="same"))
+# charts.BarVaR(R, width=36, methods=c("ModifiedES", "ModifiedVaR"))
+# dev.off()
+
+# boxplot to compare return distributions
+# mar(bottom, left, top, right)
+# default: par(mar=c(5, 4, 4, 2) + 0.1)
+# par(mar=c(10, 4, 4, 2) + 0.1)
+# boxplot(coredata(R[,order(ES(R, p=p, invert=FALSE))]),
+# cex.axis=0.8, las=3, ylab="Returns", pch=18,
+# main="Return Distribution\n(sorted by Modified ES (95%))")
+# par(mar=c(5, 4, 4, 2) + 0.1)
+# dev.off()
+
+# head(R[,order(ES(R, invert=FALSE))])
+# head(R[,order(StdDev(R))])
+# chart.Boxplot(R[,order(ES(R, invert=FALSE))])
+# chart.Boxplot(R[,order(StdDev(R))])
+# boxplot(coredata(R), col=c(2:5), cex.names=0.8, las=3)
+
+# chart the distribution of returns
+# for(i in 1:ncol(R)){
+# chart.Histogram(R[,i], methods=c("add.density", "add.normal"),
+# colorset=c("lightgray", "black", "blue"))
+# legend("topleft", legend=c("kernel density estimate", "normal"),
+# lty=c(1,1), col=c("black", "blue"), bty="n")
+# Sys.sleep(1)
+# }
+
+
+# chart the correlation and covariance
+# from http://cran.r-project.org/web/packages/corrplot/vignettes/corrplot-intro.html
+# cor.mtest <- function(mat, conf.level = 0.95) {
+# mat <- as.matrix(mat)
+# n <- ncol(mat)
+# p.mat <- lowCI.mat <- uppCI.mat <- matrix(NA, n, n)
+# diag(p.mat) <- 0
+# diag(lowCI.mat) <- diag(uppCI.mat) <- 1
+# for (i in 1:(n - 1)) {
+# for (j in (i + 1):n) {
+# tmp <- cor.test(mat[, i], mat[, j], conf.level = conf.level)
+# p.mat[i, j] <- p.mat[j, i] <- tmp$p.value
+# lowCI.mat[i, j] <- lowCI.mat[j, i] <- tmp$conf.int[1]
+# uppCI.mat[i, j] <- uppCI.mat[j, i] <- tmp$conf.int[2]
+# }
+# }
+# return(list(p.mat, lowCI.mat, uppCI.mat))
+# }
+# res <- cor.mtest(R)
+#
+# corrplot(cor(R), p.mat=res[[1]], main="Correlation",
+# sig.level=0.05, tl.cex=0.8)
+
+# corrplot(M, method="number", bg="gray", tl.cex=0.8)
+# corrplot.mixed(M, bg="gray", tl.cex=0.8)
+
+# If I compare sample min variance portfolio to a ledoit-shrinkage or robust,
+# I should use plotcov to compare covaiance matrices
+
+
+
+
Added: pkg/PortfolioAnalytics/sandbox/RFinance2014/data_prep.R
===================================================================
--- pkg/PortfolioAnalytics/sandbox/RFinance2014/data_prep.R (rev 0)
+++ pkg/PortfolioAnalytics/sandbox/RFinance2014/data_prep.R 2014-05-01 06:00:59 UTC (rev 3380)
@@ -0,0 +1,25 @@
+
+##### Equity Data for Example 1 and Example 2 #####
+load("data/crsp_weekly.rda")
+
+equity.data <- cbind(largecap_weekly[,1:15],
+ midcap_weekly[,1:15],
+ smallcap_weekly[,1:5])
+market <- largecap_weekly[,21]
+Rf <- largecap_weekly[,22]
+
+##### edhec Data for Example 3 and Example 4 #####
+# Load the updated edhec dataset
+load("data/edhec.rda")
+
+# Prep data for Examples 3 and 4
+R <- edhec[,c("Convertible.Arbitrage", "Equity.Market.Neutral",
+ "Fixed.Income.Arbitrage",
+ "CTA.Global", "Emerging.Markets", "Global.Macro")]
+# Abreviate column names for convenience and plotting
+colnames(R) <- c("CA", "EMN", "FIA", "CTAG", "EM", "GM")
+
+
+# clean up and remove the data we don't need
+rm(largecap_weekly, midcap_weekly, smallcap_weekly, microcap_weekly)
+rm(edhec)
Added: pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/bt_rb3.rda
===================================================================
(Binary files differ)
Property changes on: pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/bt_rb3.rda
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/bt_w3.rda
===================================================================
(Binary files differ)
Property changes on: pkg/PortfolioAnalytics/sandbox/RFinance2014/figures/bt_w3.rda
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
[TRUNCATED]
To get the complete diff run:
svnlook diff /svnroot/returnanalytics -r 3380
More information about the Returnanalytics-commits
mailing list