[Returnanalytics-commits] r2709 - in pkg/FactorAnalytics: R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sat Aug 3 00:47:15 CEST 2013
Author: chenyian
Date: 2013-08-03 00:47:14 +0200 (Sat, 03 Aug 2013)
New Revision: 2709
Modified:
pkg/FactorAnalytics/R/factorModelEsDecomposition.R
pkg/FactorAnalytics/R/factorModelSdDecomposition.R
pkg/FactorAnalytics/R/factorModelVaRDecomposition.R
pkg/FactorAnalytics/man/factorModelEsDecomposition.Rd
pkg/FactorAnalytics/man/factorModelSdDecomposition.Rd
pkg/FactorAnalytics/man/factorModelVaRDecomposition.Rd
Log:
debug .Rd file
Modified: pkg/FactorAnalytics/R/factorModelEsDecomposition.R
===================================================================
--- pkg/FactorAnalytics/R/factorModelEsDecomposition.R 2013-08-02 22:32:44 UTC (rev 2708)
+++ pkg/FactorAnalytics/R/factorModelEsDecomposition.R 2013-08-02 22:47:14 UTC (rev 2709)
@@ -23,21 +23,19 @@
#' @param VaR.method character, method for computing VaR. Valid choices are
#' one of "modified","gaussian","historical", "kernel". computation is done with the \code{VaR}
#' in the PerformanceAnalytics package.
-#' package.
+#'
+#'
#' @return A list with the following components:
-#' @returnItem VaR Scalar, nonparametric VaR value for fund reported as a
-#' positive number.
-#' @returnItem n.exceed Scalar, number of observations beyond VaR.
-#' @returnItem idx.exceed \code{n.exceed x 1} vector giving index values of
-#' exceedences.
-#' @returnItem ES scalar, nonparametric ES value for fund reported as a
-#' positive number.
-#' @returnItem mcES \code{(K+1) x 1} vector of factor marginal contributions to
-#' ES.
-#' @returnItem cES \code{(K+1) x 1} vector of factor component contributions to
-#' ES.
-#' @returnItem pcES \code{(K+1) x 1} vector of factor percent contributions to
-#' ES.
+#' \itemize{
+#' \item{VaR} {Scalar, nonparametric VaR value for fund reported as a
+#' positive number.}
+#' \item{n.exceed} Scalar, number of observations beyond VaR.
+#' \item{idx.exceed} \code{n.exceed x 1} vector giving index values of exceedences.
+#' \item{ES scalar} nonparametric ES value for fund reported as a positive number.
+#' \item{mcES} \code{(K+1) x 1} vector of factor marginal contributions to ES.
+#' \item{cES} \code{(K+1) x 1} vector of factor component contributions to ES.
+#' \item{pcES} \code{(K+1) x 1} vector of factor percent contributions to ES.
+#' }
#' @author Eric Zviot and Yi-An Chen.
#' @references 1. Hallerback (2003), "Decomposing Portfolio Value-at-Risk: A
#' General Analysis", \emph{The Journal of Risk} 5/2. \cr 2. Yamai and Yoshiba
@@ -57,7 +55,8 @@
#' residuals(fit.macro$asset.fit$HAM1)/sqrt(fit.macro$resid.variance[1]))
#' colnames(tmpData)[c(1,4)] = c("HAM1", "residual")
#' factor.es.decomp.HAM1 = factorModelEsDecomposition(tmpData, fit.macro$beta[1,],
-#' fit.macro$resid.variance[1], tail.prob=0.05)
+#' fit.macro$resid.variance[1], tail.prob=0.05,
+#' VaR.method="historical" )
#'
#' # fundamental factor model
#' # try to find factor contribution to ES for STI
@@ -68,7 +67,8 @@
#' colnames(tmpData)[c(1,length(tmpData[1,]))] = c("STI", "residual")
#' factorModelEsDecomposition(tmpData,
#' fit.fund$beta["STI",],
-#' fit.fund$resid.variance["STI"], tail.prob=0.05,VaR.method = "HS)
+#' fit.fund$resid.variance["STI"], tail.prob=0.05,
+#' VaR.method = "historical" )
#'
#' @export
#'
Modified: pkg/FactorAnalytics/R/factorModelSdDecomposition.R
===================================================================
--- pkg/FactorAnalytics/R/factorModelSdDecomposition.R 2013-08-02 22:32:44 UTC (rev 2708)
+++ pkg/FactorAnalytics/R/factorModelSdDecomposition.R 2013-08-02 22:47:14 UTC (rev 2709)
@@ -8,13 +8,12 @@
#' @param factor.cov k x k factor excess return covariance matrix.
#' @param sig2.e scalar, residual variance from factor model.
#' @return an S3 object containing
-#' @returnItem sd.fm Scalar, std dev based on factor model.
-#' @returnItem mcr.fm (K+1) x 1 vector of factor marginal contributions to risk
-#' (sd).
-#' @returnItem cr.fm (K+1) x 1 vector of factor component contributions to risk
-#' (sd).
-#' @returnItem pcr.fm (K+1) x 1 vector of factor percent contributions to risk
-#' (sd).
+#' \itemize{
+#' \item{sd.fm} Scalar, std dev based on factor model.
+#' \item{mcr.fm} (K+1) x 1 vector of factor marginal contributions to risk sd.
+#' \item{cr.fm} (K+1) x 1 vector of factor component contributions to risk sd.
+#' \item{pcr.fm} (K+1) x 1 vector of factor percent contributions to risk sd.
+#' }
#' @author Eric Zivot and Yi-An Chen
#' @examples
#'
Modified: pkg/FactorAnalytics/R/factorModelVaRDecomposition.R
===================================================================
--- pkg/FactorAnalytics/R/factorModelVaRDecomposition.R 2013-08-02 22:32:44 UTC (rev 2708)
+++ pkg/FactorAnalytics/R/factorModelVaRDecomposition.R 2013-08-02 22:47:14 UTC (rev 2709)
@@ -21,17 +21,16 @@
#' one of "modified","gaussian","historical", "kernel". computation is done with the \code{VaR}
#' in the PerformanceAnalytics package.
#' @return an S3 object containing
-#' @returnItem VaR.fm Scalar, bootstrap VaR value for fund reported as a
+#' \itemize{
+#' \item{VaR.fm} Scalar, bootstrap VaR value for fund reported as a
#' positive number.
-#' @returnItem n.exceed Scalar, number of observations beyond VaR.
-#' @returnItem idx.exceed n.exceed x 1 vector giving index values of
+#' \item{n.exceed} Scalar, number of observations beyond VaR.
+#' \item{idx.exceed} n.exceed x 1 vector giving index values of
#' exceedences.
-#' @returnItem mVaR.fm (K+1) x 1 vector of factor marginal contributions to
-#' VaR.
-#' @returnItem cVaR.fm (K+1) x 1 vector of factor component contributions to
-#' VaR.
-#' @returnItem pcVaR.fm (K+1) x 1 vector of factor percent contributions to
-#' VaR.
+#' \item{mVaR.fm} (K+1) x 1 vector of factor marginal contributions to VaR.
+#' \item{cVaR.fm} (K+1) x 1 vector of factor component contributions to VaR.
+#' \item{pcVaR.fm} (K+1) x 1 vector of factor percent contributions to VaR.
+#' }
#' @author Eric Zivot and Yi-An Chen
#' @references 1. Hallerback (2003), "Decomposing Portfolio Value-at-Risk: A
#' General Analysis", The Journal of Risk 5/2. 2. Yamai and Yoshiba (2002).
@@ -52,7 +51,7 @@
#' colnames(tmpData)[c(1,4)] = c("HAM1", "residual")
#' factor.VaR.decomp.HAM1 = factorModelVaRDecomposition(tmpData, fit.macro$beta[1,],
#' fit.macro$resid.variance[1], tail.prob=0.05,
-#' VaR.method="historical)
+#' VaR.method="historical")
#'
#' @export
factorModelVaRDecomposition <-
Modified: pkg/FactorAnalytics/man/factorModelEsDecomposition.Rd
===================================================================
--- pkg/FactorAnalytics/man/factorModelEsDecomposition.Rd 2013-08-02 22:32:44 UTC (rev 2708)
+++ pkg/FactorAnalytics/man/factorModelEsDecomposition.Rd 2013-08-02 22:47:14 UTC (rev 2709)
@@ -26,10 +26,20 @@
Valid choices are one of
"modified","gaussian","historical", "kernel". computation
is done with the \code{VaR} in the PerformanceAnalytics
- package. package.}
+ package.}
}
\value{
- A list with the following components:
+ A list with the following components: \itemize{
+ \item{VaR} {Scalar, nonparametric VaR value for fund
+ reported as a positive number.} \item{n.exceed} Scalar,
+ number of observations beyond VaR. \item{idx.exceed}
+ \code{n.exceed x 1} vector giving index values of
+ exceedences. \item{ES scalar} nonparametric ES value for
+ fund reported as a positive number. \item{mcES}
+ \code{(K+1) x 1} vector of factor marginal contributions
+ to ES. \item{cES} \code{(K+1) x 1} vector of factor
+ component contributions to ES. \item{pcES} \code{(K+1) x
+ 1} vector of factor percent contributions to ES. }
}
\description{
Compute the factor model factor expected shortfall (ES)
@@ -59,7 +69,8 @@
residuals(fit.macro$asset.fit$HAM1)/sqrt(fit.macro$resid.variance[1]))
colnames(tmpData)[c(1,4)] = c("HAM1", "residual")
factor.es.decomp.HAM1 = factorModelEsDecomposition(tmpData, fit.macro$beta[1,],
- fit.macro$resid.variance[1], tail.prob=0.05)
+ fit.macro$resid.variance[1], tail.prob=0.05,
+ VaR.method="historical" )
# fundamental factor model
# try to find factor contribution to ES for STI
@@ -70,7 +81,8 @@
colnames(tmpData)[c(1,length(tmpData[1,]))] = c("STI", "residual")
factorModelEsDecomposition(tmpData,
fit.fund$beta["STI",],
- fit.fund$resid.variance["STI"], tail.prob=0.05,VaR.method = "HS)
+ fit.fund$resid.variance["STI"], tail.prob=0.05,
+ VaR.method = "historical" )
}
\author{
Eric Zviot and Yi-An Chen.
Modified: pkg/FactorAnalytics/man/factorModelSdDecomposition.Rd
===================================================================
--- pkg/FactorAnalytics/man/factorModelSdDecomposition.Rd 2013-08-02 22:32:44 UTC (rev 2708)
+++ pkg/FactorAnalytics/man/factorModelSdDecomposition.Rd 2013-08-02 22:47:14 UTC (rev 2709)
@@ -15,7 +15,12 @@
model.}
}
\value{
- an S3 object containing
+ an S3 object containing \itemize{ \item{sd.fm} Scalar,
+ std dev based on factor model. \item{mcr.fm} (K+1) x 1
+ vector of factor marginal contributions to risk sd.
+ \item{cr.fm} (K+1) x 1 vector of factor component
+ contributions to risk sd. \item{pcr.fm} (K+1) x 1 vector
+ of factor percent contributions to risk sd. }
}
\description{
Compute factor model factor risk (sd) decomposition for
Modified: pkg/FactorAnalytics/man/factorModelVaRDecomposition.Rd
===================================================================
--- pkg/FactorAnalytics/man/factorModelVaRDecomposition.Rd 2013-08-02 22:32:44 UTC (rev 2708)
+++ pkg/FactorAnalytics/man/factorModelVaRDecomposition.Rd 2013-08-02 22:47:14 UTC (rev 2709)
@@ -26,7 +26,15 @@
package.}
}
\value{
- an S3 object containing
+ an S3 object containing \itemize{ \item{VaR.fm} Scalar,
+ bootstrap VaR value for fund reported as a positive
+ number. \item{n.exceed} Scalar, number of observations
+ beyond VaR. \item{idx.exceed} n.exceed x 1 vector giving
+ index values of exceedences. \item{mVaR.fm} (K+1) x 1
+ vector of factor marginal contributions to VaR.
+ \item{cVaR.fm} (K+1) x 1 vector of factor component
+ contributions to VaR. \item{pcVaR.fm} (K+1) x 1 vector of
+ factor percent contributions to VaR. }
}
\description{
Compute factor model factor VaR decomposition based on
@@ -56,7 +64,7 @@
colnames(tmpData)[c(1,4)] = c("HAM1", "residual")
factor.VaR.decomp.HAM1 = factorModelVaRDecomposition(tmpData, fit.macro$beta[1,],
fit.macro$resid.variance[1], tail.prob=0.05,
- VaR.method="historical)
+ VaR.method="historical")
}
\author{
Eric Zivot and Yi-An Chen
More information about the Returnanalytics-commits
mailing list