[Returnanalytics-commits] r1978 - pkg/PApages/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Jun 5 02:47:16 CEST 2012
Author: peter_carl
Date: 2012-06-05 02:47:15 +0200 (Tue, 05 Jun 2012)
New Revision: 1978
Modified:
pkg/PApages/R/page.Autocorrelation.R
pkg/PApages/R/page.Capture.R
pkg/PApages/R/page.Distribution.R
pkg/PApages/R/page.HigherMomentsTable.R
pkg/PApages/R/page.Performance.R
pkg/PApages/R/page.Regression.R
pkg/PApages/R/page.RollingStyle.R
pkg/PApages/R/page.Scatter.R
pkg/PApages/R/page.Summary.R
pkg/PApages/R/page.SummaryTables.R
pkg/PApages/R/page.VaR.R
Log:
- slight edits to avoid warnings
Modified: pkg/PApages/R/page.Autocorrelation.R
===================================================================
--- pkg/PApages/R/page.Autocorrelation.R 2012-06-04 18:44:37 UTC (rev 1977)
+++ pkg/PApages/R/page.Autocorrelation.R 2012-06-05 00:47:15 UTC (rev 1978)
@@ -34,7 +34,7 @@
minu = min(minA, minP, L) - .01
op <- par(no.readonly=TRUE)
- layout(matrix(c(1,2,3),nrow=3,ncol=1),height=c(1,1,2),width=1)
+ layout(matrix(c(1,2,3),nrow=3,ncol=1),heights=c(1,1,2),widths=1)
# mar: a numerical vector of the form c(bottom, left, top, right) which
# gives the number of lines of margin to be specified on the four sides
Modified: pkg/PApages/R/page.Capture.R
===================================================================
--- pkg/PApages/R/page.Capture.R 2012-06-04 18:44:37 UTC (rev 1977)
+++ pkg/PApages/R/page.Capture.R 2012-06-05 00:47:15 UTC (rev 1978)
@@ -31,7 +31,7 @@
legend.loc = NULL
op <- par(no.readonly=TRUE)
- layout(matrix(c(1,2,3,4),nrow=2,byrow=TRUE), height = c(1,1.5), width = 1)
+ layout(matrix(c(1,2,3,4),nrow=2,byrow=TRUE), heights = c(1,1.5), widths = 1)
# mar: a numerical vector of the form c(bottom, left, top, right) which
# gives the number of lines of margin to be specified on the four sides
Modified: pkg/PApages/R/page.Distribution.R
===================================================================
--- pkg/PApages/R/page.Distribution.R 2012-06-04 18:44:37 UTC (rev 1977)
+++ pkg/PApages/R/page.Distribution.R 2012-06-05 00:47:15 UTC (rev 1978)
@@ -48,11 +48,11 @@
op <- par(no.readonly=TRUE)
# First, we lay out the graphic as a two row, two column format
- layout(matrix(c(1,2,3,4,5,6),ncol=2,byrow=TRUE), height = c(1,1,1), width = 1)
+ layout(matrix(c(1,2,3,4,5,6),ncol=2,byrow=TRUE), heights = c(1,1,1), widths = 1)
par(cex = 0.8)
# Panel 1, Distribution of historical data, risk measures, normal fit
- chart.Histogram(x[, c(manager.column), drop = FALSE], probability=TRUE, show.outliers=TRUE, main="Gaussian", note.lines = c(hVaR, pVaR, mVaR, stVaR, spVaR), note.labels = c("Historical VaR", "Parametric VaR", "Modified VaR", "", ""), note.color=c("darkblue", "darkgray", "darkgray", "darkgray", "darkgray"), methods=c("add.density","add.normal"), cex.axis=0.8, cex=.8)
+ chart.Histogram(x[, c(manager.column), drop = FALSE], probability=TRUE, show.outliers=TRUE, main="Gaussian", note.lines = c(hVaR, pVaR, mVaR, stVaR, spVaR), note.labels = c("Historical VaR", "Parametric VaR", "Modified VaR", "", ""), note.color=c("darkblue", "darkgray", "darkgray", "darkgray", "darkgray"), methods=c("add.density","add.normal"), cex.axis=0.8)
par(cex = 0.8)
# Panel 2, QQ Plot using Normal distribution
@@ -60,7 +60,7 @@
par(cex = 0.8)
# Panel 3, ECDF?
- chart.Histogram(x[, c(manager.column), drop = FALSE], probability=T, show.outliers=T, main="Skew-T", note.lines = c(hVaR, pVaR, mVaR, stVaR, spVaR), note.labels = c("", "", "", "Skew-T VaR", ""), note.color=c("darkgray", "darkgray", "darkgray", "darkblue", "darkgray"), methods="add.sst", cex.axis=0.8, cex=.8)
+ chart.Histogram(x[, c(manager.column), drop = FALSE], probability=T, show.outliers=T, main="Skew-T", note.lines = c(hVaR, pVaR, mVaR, stVaR, spVaR), note.labels = c("", "", "", "Skew-T VaR", ""), note.color=c("darkgray", "darkgray", "darkgray", "darkblue", "darkgray"), methods="add.sst", cex.axis=0.8)
# chart.ECDF(x[, c(manager.column), drop = FALSE], main = "ECDF", lwd = 2)
@@ -73,7 +73,7 @@
# library(zoo)
par(cex = 0.8)
- chart.Histogram(x[, c(manager.column), drop = FALSE], probability=T, show.outliers=T, main="Stable", note.lines = c(hVaR, pVaR, mVaR, stVaR, spVaR), note.labels = c("", "", "", "", "Stable VaR"), note.color=c("darkgray", "darkgray", "darkgray", "darkgray", "darkblue"), methods="add.stable", cex.axis=0.8, cex=.8)
+ chart.Histogram(x[, c(manager.column), drop = FALSE], probability=T, show.outliers=T, main="Stable", note.lines = c(hVaR, pVaR, mVaR, stVaR, spVaR), note.labels = c("", "", "", "", "Stable VaR"), note.color=c("darkgray", "darkgray", "darkgray", "darkgray", "darkblue"), methods="add.stable", cex.axis=0.8)
# chart.ACF(x[, c(manager.column, peer.columns, index.columns), drop = FALSE], main = "Autocorrelation")
par(cex = 0.8)
Modified: pkg/PApages/R/page.HigherMomentsTable.R
===================================================================
--- pkg/PApages/R/page.HigherMomentsTable.R 2012-06-04 18:44:37 UTC (rev 1977)
+++ pkg/PApages/R/page.HigherMomentsTable.R 2012-06-05 00:47:15 UTC (rev 1978)
@@ -4,7 +4,7 @@
colorset = c(rep(manager.color,length(manager.column)), rep(index.color, length(index.columns)), rep(peer.color,length(peer.columns)))
# First, create the table
- w = t(table.HigherMoments(R[,c(manager.column, index.columns, peer.columns),drop=FALSE], R[,index.columns[1],drop=FALSE], digits=4, rf=rf))[,c(3,4,5)]
+ w = t(table.HigherMoments(R[,c(manager.column, index.columns, peer.columns),drop=FALSE], R[,index.columns[1],drop=FALSE], digits=4))[,c(3,4,5)]
# Sort the table by Sharpe ratio
w.order = order(w[,2], decreasing=FALSE)
Modified: pkg/PApages/R/page.Performance.R
===================================================================
--- pkg/PApages/R/page.Performance.R 2012-06-04 18:44:37 UTC (rev 1977)
+++ pkg/PApages/R/page.Performance.R 2012-06-05 00:47:15 UTC (rev 1978)
@@ -35,7 +35,7 @@
main = paste(colnames[manager.column],"Performance", sep=" ")
op <- par(no.readonly=TRUE)
- layout(matrix(c(1,2,3,4)),height=c(2.2,1.6,2.2,3),width=1)
+ layout(matrix(c(1,2,3,4)),heights=c(2.2,1.6,2.2,3),widths=1)
# mar: a numerical vector of the form c(bottom, left, top, right) which
# gives the number of lines of margin to be specified on the four sides
Modified: pkg/PApages/R/page.Regression.R
===================================================================
--- pkg/PApages/R/page.Regression.R 2012-06-04 18:44:37 UTC (rev 1977)
+++ pkg/PApages/R/page.Regression.R 2012-06-05 00:47:15 UTC (rev 1978)
@@ -33,7 +33,7 @@
legend.loc = NULL
op <- par(no.readonly=TRUE)
- layout(matrix(c(1,1,2,2,3,3,4,5),ncol=2,byrow=TRUE), height = c(2.2,1.6,2.2,3), width = 1)
+ layout(matrix(c(1,1,2,2,3,3,4,5),ncol=2,byrow=TRUE), heights = c(2.2,1.6,2.2,3), widths = 1)
# mar: a numerical vector of the form c(bottom, left, top, right) which
# gives the number of lines of margin to be specified on the four sides
Modified: pkg/PApages/R/page.RollingStyle.R
===================================================================
--- pkg/PApages/R/page.RollingStyle.R 2012-06-04 18:44:37 UTC (rev 1977)
+++ pkg/PApages/R/page.RollingStyle.R 2012-06-05 00:47:15 UTC (rev 1978)
@@ -48,7 +48,7 @@
# gives the number of lines of margin to be specified on the four sides
# of the plot. The default is c(5, 4, 4, 2) + 0.1
op <- par(oma = c(2,0,4,0), mar=c(0,4,0,4))
- layout(matrix(c(1:columns.style, columns.style+1, columns.style+2), nc = 1, byrow = TRUE))
+ layout(matrix(c(1:columns.style, columns.style+1, columns.style+2), ncol = 1, byrow = TRUE))
for(i in 1:columns.style){
if(even(i))
Modified: pkg/PApages/R/page.Scatter.R
===================================================================
--- pkg/PApages/R/page.Scatter.R 2012-06-04 18:44:37 UTC (rev 1977)
+++ pkg/PApages/R/page.Scatter.R 2012-06-05 00:47:15 UTC (rev 1978)
@@ -35,7 +35,7 @@
op <- par(no.readonly=TRUE)
# First, we lay out the graphic as a two row, two column format
- layout(matrix(c(1,1,2,3),nrow=2,ncol=2,byrow=T),height=c(6,3),width=1)
+ layout(matrix(c(1,1,2,3),nrow=2,ncol=2,byrow=T),heights=c(6,3),widths=1)
# mar: a numerical vector of the form c(bottom, left, top, right) which
# gives the number of lines of margin to be specified on the four sides
Modified: pkg/PApages/R/page.Summary.R
===================================================================
--- pkg/PApages/R/page.Summary.R 2012-06-04 18:44:37 UTC (rev 1977)
+++ pkg/PApages/R/page.Summary.R 2012-06-05 00:47:15 UTC (rev 1978)
@@ -1,5 +1,5 @@
page.Summary <-
-function (R, manager.column = 1, peer.columns = NULL, index.columns = NULL, manager.color = "red", peer.color = "darkgray", index.color = "orange", Rf = 0, main = NULL, method = c("ModifiedVaR", "HistoricalVaR"), width = 0, event.labels = NULL, ylog = FALSE, wealth.index = FALSE, gap = 12, begin=c("first","axis"), legend.loc="topleft", lwd = 2, ...)
+function (R, manager.column = 1, peer.columns = NULL, index.columns = NULL, manager.color = "red", peer.color = "darkgray", index.color = "orange", Rf = 0, main = NULL, methods = c("ModifiedVaR", "HistoricalVaR"), width = 0, event.labels = NULL, ylog = FALSE, wealth.index = FALSE, gap = 12, begin=c("first","axis"), legend.loc="topleft", lwd = 2, ...)
{ # @author Peter Carl
begin = begin[1]
@@ -38,7 +38,7 @@
wealth.index = TRUE
op <- par(no.readonly=TRUE)
- layout(matrix(c(1,2,3,4),nrow=4,ncol=1),height=c(3,1.25,1.75,3),width=1)
+ layout(matrix(c(1,2,3,4),nrow=4,ncol=1),heights=c(3,1.25,1.75,3), widths=1)
# mar: a numerical vector of the form c(bottom, left, top, right) which
# gives the number of lines of margin to be specified on the four sides
@@ -54,7 +54,7 @@
# The second row is the monthly returns bar plot
par(mar=c(1,4,0,2))
- chart.BarVaR(x[,c(manager.column,index.columns,peer.columns),drop = FALSE], main = "", xaxis = FALSE, width = width, ylab = "Monthly Return", method = method, event.labels = NULL, ylog=FALSE, gap = gap, colorset = colorset, lwd = lwd, cex.axis=1, ...)
+ chart.BarVaR(x[,c(manager.column,index.columns,peer.columns),drop = FALSE], main = "", xaxis = FALSE, width = width, ylab = "Monthly Return", methods = methods, event.labels = NULL, ylog=FALSE, gap = gap, colorset = colorset, lwd = lwd, cex.axis=1, ...)
# The third row is the underwater plot
par(mar=c(3,4,0,2))
Modified: pkg/PApages/R/page.SummaryTables.R
===================================================================
--- pkg/PApages/R/page.SummaryTables.R 2012-06-04 18:44:37 UTC (rev 1977)
+++ pkg/PApages/R/page.SummaryTables.R 2012-06-05 00:47:15 UTC (rev 1978)
@@ -22,7 +22,7 @@
x = x[start.row:length.column.one,]
op <- par(no.readonly=TRUE)
- layout(matrix(c(1,1,2,3,4,4), ncol=2,byrow=TRUE),height=c(3,5,1),width=1)
+ layout(matrix(c(1,1,2,3,4,4), ncol=2, byrow=TRUE), heights=c(3,5,1), widths=1)
layout.show(4)
calendar = table.CalendarReturns(x[,c(manager.column, index.columns), drop=FALSE])
Modified: pkg/PApages/R/page.VaR.R
===================================================================
--- pkg/PApages/R/page.VaR.R 2012-06-04 18:44:37 UTC (rev 1977)
+++ pkg/PApages/R/page.VaR.R 2012-06-05 00:47:15 UTC (rev 1978)
@@ -31,7 +31,7 @@
legend.loc = NULL
op <- par(no.readonly=TRUE)
- layout(matrix(c(1,1,2,2,3,4),nrow=3,byrow=TRUE), height = c(1,1), width = 1)
+ layout(matrix(c(1,1,2,2,3,4),nrow=3,byrow=TRUE), heights = c(1,1), widths = 1)
# mar: a numerical vector of the form c(bottom, left, top, right) which
# gives the number of lines of margin to be specified on the four sides
@@ -39,9 +39,9 @@
# The first three rows are the rolling window chart of the Excess returns of the index versus the benchmark
par(mar=c(3,4,4,2)+0.1)
- chart.BarVaR(x[,c(manager.column,index.columns,peer.columns),drop = FALSE], main = "Comparing VaR to Peers", width = width, ylab = "Monthly Return", method = method[2], event.labels = NULL, ylog=FALSE, gap = gap, colorset = colorset, lwd = lwd, cex.axis=1, all=TRUE, lty=linetypes, xlab="", ...)
+ chart.BarVaR(x[,c(manager.column,index.columns,peer.columns),drop = FALSE], main = "Comparing VaR to Peers", width = width, ylab = "Monthly Return", methods = method[2], event.labels = NULL, ylog=FALSE, gap = gap, colorset = colorset, lwd = lwd, cex.axis=1, all=TRUE, lty=linetypes, xlab="", ...)
par(mar=c(3,4,4,2)+0.1)
- chart.BarVaR(x[,c(manager.column,index.columns,peer.columns),drop = FALSE], main = "Comparing Methods", width = width, ylab = "Monthly Return", method = method, event.labels = NULL, ylog=FALSE, gap = gap, colorset = colorset, lwd = lwd, cex.axis=1, clean="boudt", show.clean=TRUE, xlab="", ...)
+ chart.BarVaR(x[,c(manager.column,index.columns,peer.columns),drop = FALSE], main = "Comparing Methods", width = width, ylab = "Monthly Return", methods = method, event.labels = NULL, ylog=FALSE, gap = gap, colorset = colorset, lwd = lwd, cex.axis=1, clean="boudt", show.clean=TRUE, xlab="", ...)
par(mar=c(5,4,4,2)+0.1)
chart.VaRSensitivity(x[,manager.column,drop=FALSE], lwd=2, main="Raw", ylim=c(-.08,0))
More information about the Returnanalytics-commits
mailing list