[Returnanalytics-commits] r3802 - pkg/Dowd/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Jul 13 13:35:14 CEST 2015
Author: dacharya
Date: 2015-07-13 13:35:13 +0200 (Mon, 13 Jul 2015)
New Revision: 3802
Modified:
pkg/Dowd/R/LogtES.R
Log:
Minor mistakes in documentation.
Modified: pkg/Dowd/R/LogtES.R
===================================================================
--- pkg/Dowd/R/LogtES.R 2015-07-09 14:28:27 UTC (rev 3801)
+++ pkg/Dowd/R/LogtES.R 2015-07-13 11:35:13 UTC (rev 3802)
@@ -1,7 +1,7 @@
#' ES for t distributed geometric returns
#'
#' Estimates the ES of a portfolio assuming that geometric returns are
-#' Student t distributed, for specified confidence level and holding period.
+#' Student-t distributed, for specified confidence level and holding period.
#'
#' @param returns Vector of daily geometric return data
#' @param mu Mean of daily geometric return data
@@ -105,9 +105,11 @@
stop("Confidence level(s) must be greater than 0")
}
if (min(hp) <= 0){
- stop("Confidence level(s) must be greater than 0")
+ stop("Holding Period(s) must be greater than 0")
}
# VaR estimation
+ cl.row <- dim(cl)[1]
+ cl.col <- dim(cl)[2]
VaR <- investment - exp(((df - 2) / df) * sigma %*% sqrt(t(hp)) %*% qt(1 - cl, df)
+ mu * t(hp) %*% matrix(1, cl.row, cl.col) + log(investment)) # VaR
# ES estimation
More information about the Returnanalytics-commits
mailing list