[Returnanalytics-commits] r3339 - pkg/PerformanceAnalytics/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Feb 26 00:46:32 CET 2014
Author: peter_carl
Date: 2014-02-26 00:46:31 +0100 (Wed, 26 Feb 2014)
New Revision: 3339
Modified:
pkg/PerformanceAnalytics/R/Return.calculate.R
pkg/PerformanceAnalytics/R/chart.RollingPerformance.R
pkg/PerformanceAnalytics/R/chart.TimeSeries.R
pkg/PerformanceAnalytics/R/decomposeMVaR.R
Log:
- removed ':::' to internal functions and exported xts functions
Modified: pkg/PerformanceAnalytics/R/Return.calculate.R
===================================================================
--- pkg/PerformanceAnalytics/R/Return.calculate.R 2014-02-25 22:51:30 UTC (rev 3338)
+++ pkg/PerformanceAnalytics/R/Return.calculate.R 2014-02-25 23:46:31 UTC (rev 3339)
@@ -70,7 +70,7 @@
if(method=="simple" || method=='discrete'){
#Returns = pr/pr[-nrow(pr), ] - 1
- Returns = pr/xts:::lagts.xts(pr) - 1
+ Returns = pr/lag(pr) - 1
xtsAttributes(Returns) <- list(ret_type="discrete")
}
if(method=="compound" || method=='log') {
Modified: pkg/PerformanceAnalytics/R/chart.RollingPerformance.R
===================================================================
--- pkg/PerformanceAnalytics/R/chart.RollingPerformance.R 2014-02-25 22:51:30 UTC (rev 3338)
+++ pkg/PerformanceAnalytics/R/chart.RollingPerformance.R 2014-02-25 23:46:31 UTC (rev 3339)
@@ -79,7 +79,7 @@
for(column in 1:columns) {
# the drop=FALSE flag is essential for when the zoo object only has one column
rollargs<-c(list(data=na.omit(x[,column,drop=FALSE])),funargs)
- column.Return.calc <- do.call(xts:::rollapply.xts,rollargs)
+ column.Return.calc <- do.call(rollapply,rollargs)
if(column == 1)
Return.calc = xts(column.Return.calc)
else
Modified: pkg/PerformanceAnalytics/R/chart.TimeSeries.R
===================================================================
--- pkg/PerformanceAnalytics/R/chart.TimeSeries.R 2014-02-25 22:51:30 UTC (rev 3338)
+++ pkg/PerformanceAnalytics/R/chart.TimeSeries.R 2014-02-25 23:46:31 UTC (rev 3339)
@@ -234,7 +234,7 @@
)
}
# Needed for finding aligned dates for event lines and period areas
- rownames = as.Date(xts:::time.xts(y))
+ rownames = as.Date(time(y))
rownames = format(strptime(rownames,format = date.format.in), date.format)
time.scale = periodicity(y)$scale
Modified: pkg/PerformanceAnalytics/R/decomposeMVaR.R
===================================================================
--- pkg/PerformanceAnalytics/R/decomposeMVaR.R 2014-02-25 22:51:30 UTC (rev 3338)
+++ pkg/PerformanceAnalytics/R/decomposeMVaR.R 2014-02-25 23:46:31 UTC (rev 3339)
@@ -4,28 +4,28 @@
{
return(t(w)%*%sigma%*%w)
}
-PerformanceAnalytics:::portm2
+portm2
portm3 = function(w,M3)
{
return(t(w)%*%M3%*%(w%x%w))
}
-PerformanceAnalytics:::portm3
+portm3
table.VaR.CornishFisher.portfolio =
function (p, w, mu, sigma, M3, M4 , names)
{
w = matrix( w , ncol = 1 )
- alpha = PerformanceAnalytics:::.setalphaprob(p)
+ alpha = .setalphaprob(p)
p = alpha
z = qnorm(alpha)
location = t(w) %*% mu
pm2 = portm2(w, sigma)
- dpm2 = as.vector(PerformanceAnalytics:::derportm2(w, sigma))
+ dpm2 = as.vector(derportm2(w, sigma))
pm3 = portm3(w, M3)
- dpm3 = as.vector(PerformanceAnalytics:::derportm3(w, M3))
- pm4 = PerformanceAnalytics:::portm4(w, M4)
- dpm4 = as.vector(PerformanceAnalytics:::derportm4(w, M4))
+ dpm3 = as.vector(derportm3(w, M3))
+ pm4 = portm4(w, M4)
+ dpm4 = as.vector(derportm4(w, M4))
skew = pm3/pm2^(3/2)
exkurt = pm4/pm2^(2) - 3
derskew = (2 * (pm2^(3/2)) * dpm3 - 3 * pm3 * sqrt(pm2) *
More information about the Returnanalytics-commits
mailing list