[Returnanalytics-commits] r2741 - in pkg/FactorAnalytics: . R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Aug 8 19:52:59 CEST 2013
Author: chenyian
Date: 2013-08-08 19:52:59 +0200 (Thu, 08 Aug 2013)
New Revision: 2741
Added:
pkg/FactorAnalytics/man/CornishFisher.Rd
Removed:
pkg/FactorAnalytics/man/rCornishFisher.Rd
Modified:
pkg/FactorAnalytics/NAMESPACE
pkg/FactorAnalytics/R/fitFundamentalFactorModel.R
pkg/FactorAnalytics/R/rCornishFisher.R
pkg/FactorAnalytics/man/
pkg/FactorAnalytics/man/fitFundamentalFactorModel.Rd
Log:
debug CornishFisher.Rd document
Modified: pkg/FactorAnalytics/NAMESPACE
===================================================================
--- pkg/FactorAnalytics/NAMESPACE 2013-08-08 10:24:51 UTC (rev 2740)
+++ pkg/FactorAnalytics/NAMESPACE 2013-08-08 17:52:59 UTC (rev 2741)
@@ -1,3 +1,4 @@
+export(CornishFisher)
export(dCornishFisher)
export(factorModelCovariance)
export(factorModelEsDecomposition)
@@ -9,7 +10,6 @@
export(fitTimeSeriesFactorModel)
export(pCornishFisher)
export(qCornishFisher)
-export(rCornishFisher)
S3method(plot,FundamentalFactorModel)
S3method(plot,StatFactorModel)
S3method(plot,TimeSeriesFactorModel)
Modified: pkg/FactorAnalytics/R/fitFundamentalFactorModel.R
===================================================================
--- pkg/FactorAnalytics/R/fitFundamentalFactorModel.R 2013-08-08 10:24:51 UTC (rev 2740)
+++ pkg/FactorAnalytics/R/fitFundamentalFactorModel.R 2013-08-08 17:52:59 UTC (rev 2741)
@@ -42,9 +42,9 @@
#' @param assetvar A character string gives the name of the asset variable in
#' the data.
#' @param standardized.factor.exposure logical flag. Factor exposure will be standarized
-#' to regression weighted mean 0 and standardized deviation to 1 if \code(TRUE).
-#' Default is \code(FALSE). See Detail.
-#' @param weight.var. A character strping gives the name of the weight used for standarizing factor exposures.
+#' to regression weighted mean 0 and standardized deviation to 1 if \code{TRUE}.
+#' Default is \code{FALSE}. See Detail.
+#' @param weight.var A character strping gives the name of the weight used for standarizing factor exposures.
#' @return an S3 object containing
#' \itemize{
#' \item returns.cov A "list" object contains covariance information for
Modified: pkg/FactorAnalytics/R/rCornishFisher.R
===================================================================
--- pkg/FactorAnalytics/R/rCornishFisher.R 2013-08-08 10:24:51 UTC (rev 2740)
+++ pkg/FactorAnalytics/R/rCornishFisher.R 2013-08-08 17:52:59 UTC (rev 2741)
@@ -1,6 +1,8 @@
#' Functions for Cornish-Fisher density, CDF, random number simulation and
#' quantile.
#'
+#'@name CornishFisher
+#'@aliases CornishFisher
#'@aliases rCornishFisher
#'@aliases dCornishFisher
#'@aliases qCornishFisher
@@ -46,6 +48,7 @@
#' @details CDF(q) = Pr(sqrt(n)*(x_bar-mu)/sigma < q)
#'
#' @examples
+#' \dontrun{
#' # generate 1000 observation from Cornish-Fisher distribution
#' rc <- rCornishFisher(1000,1,0,5)
#'hist(rc,breaks=100,freq=FALSE,main="simulation of Cornish Fisher Distribution",
@@ -63,7 +66,7 @@
#' pnorm(q)
#' # use edgeworth expansion
#' pCornishFisher(q,n=5,skew=2,ekurt=6)
-#'
+#' }
Property changes on: pkg/FactorAnalytics/man
___________________________________________________________________
Modified: svn:ignore
- CornishFisher.Rd
Style.Rd
covEWMA.Rd
factorModelPerformanceAttribution.Rd
impliedFactorReturns.Rd
modifiedEsReport.Rd
modifiedIncrementalES.Rd
modifiedIncrementalVaR.Rd
modifiedPortfolioEsDecomposition.Rd
modifiedPortfolioVaRDecomposition.Rd
modifiedVaRReport.Rd
nonparametricEsReport.Rd
nonparametricIncrementalES.Rd
nonparametricIncrementalVaR.Rd
nonparametricPortfolioEsDecomposition.Rd
nonparametricPortfolioVaRDecomposition.Rd
nonparametricVaRReport.Rd
normalEsReport.Rd
normalIncrementalES.Rd
normalIncrementalVaR.Rd
normalPortfolioEsDecomposition.Rd
normalPortfolioVaRDecomposition.Rd
normalVaRReport.Rd
plot.FM.attribution.Rd
plot.MacroFactorModel.Rd
portfolioSdDecomposition.Rd
print.MacroFactorModel.Rd
scenarioPredictions.Rd
scenarioPredictionsPortfolio.Rd
stock.Rd
summary.FM.attribution.Rd
summary.MacroFactorModel.Rd
summary.TimeSeriesModel.Rd
+ CornishFisher.Rd
Style.Rd
covEWMA.Rd
factorModelPerformanceAttribution.Rd
impliedFactorReturns.Rd
modifiedEsReport.Rd
modifiedIncrementalES.Rd
modifiedIncrementalVaR.Rd
modifiedPortfolioEsDecomposition.Rd
modifiedPortfolioVaRDecomposition.Rd
modifiedVaRReport.Rd
nonparametricEsReport.Rd
nonparametricIncrementalES.Rd
nonparametricIncrementalVaR.Rd
nonparametricPortfolioEsDecomposition.Rd
nonparametricPortfolioVaRDecomposition.Rd
nonparametricVaRReport.Rd
normalEsReport.Rd
normalIncrementalES.Rd
normalIncrementalVaR.Rd
normalPortfolioEsDecomposition.Rd
normalPortfolioVaRDecomposition.Rd
normalVaRReport.Rd
plot.FM.attribution.Rd
plot.MacroFactorModel.Rd
portfolioSdDecomposition.Rd
print.MacroFactorModel.Rd
rCornishFisher.Rd
scenarioPredictions.Rd
scenarioPredictionsPortfolio.Rd
stock.Rd
summary.FM.attribution.Rd
summary.MacroFactorModel.Rd
summary.TimeSeriesModel.Rd
Added: pkg/FactorAnalytics/man/CornishFisher.Rd
===================================================================
--- pkg/FactorAnalytics/man/CornishFisher.Rd (rev 0)
+++ pkg/FactorAnalytics/man/CornishFisher.Rd 2013-08-08 17:52:59 UTC (rev 2741)
@@ -0,0 +1,80 @@
+\name{CornishFisher}
+\alias{CornishFisher}
+\alias{dCornishFisher}
+\alias{pCornishFisher}
+\alias{qCornishFisher}
+\alias{rCornishFisher}
+\title{Functions for Cornish-Fisher density, CDF, random number simulation and
+quantile.}
+\usage{
+ rCornishFisher(n, sigma, skew, ekurt, seed = NULL)
+}
+\arguments{
+ \item{n}{scalar, number of simulated values in
+ rCornishFisher. Sample length in
+ density,distribution,quantile function.}
+
+ \item{sigma}{scalar, standard deviation.}
+
+ \item{skew}{scalar, skewness.}
+
+ \item{ekurt}{scalar, excess kurtosis.}
+
+ \item{seed}{set seed here. Default is \code{NULL}.}
+
+ \item{x,q}{vector of standardized quantiles. See detail.}
+
+ \item{p}{vector of probabilities.}
+}
+\value{
+ n simulated values from Cornish-Fisher distribution.
+}
+\description{
+ \itemize{ \item \code{rCornishFisher} simulate
+ observations based on Cornish-Fisher quantile expansion
+ given mean, standard deviation, skewness and excess
+ kurtosis. \item \code{dCornishFisher} Computes
+ Cornish-Fisher density from two term Edgeworth expansion
+ given mean, standard deviation, skewness and excess
+ kurtosis. \item \code{pCornishFisher} Computes
+ Cornish-Fisher CDF from two term Edgeworth expansion
+ given mean, standard deviation, skewness and excess
+ kurtosis. \item \code{qCornishFisher} Computes
+ Cornish-Fisher quantiles from two term Edgeworth
+ expansion given mean, standard deviation, skewness and
+ excess kurtosis. }
+}
+\details{
+ CDF(q) = Pr(sqrt(n)*(x_bar-mu)/sigma < q)
+}
+\examples{
+\dontrun{
+ # generate 1000 observation from Cornish-Fisher distribution
+rc <- rCornishFisher(1000,1,0,5)
+hist(rc,breaks=100,freq=FALSE,main="simulation of Cornish Fisher Distribution",
+ xlim=c(-10,10))
+lines(seq(-10,10,0.1),dnorm(seq(-10,10,0.1),mean=0,sd=1),col=2)
+# compare with standard normal curve
+
+# example from A.dasGupta p.188 exponential example
+# x is iid exp(1) distribution, sample size = 5
+# then x_bar is Gamma(shape=5,scale=1/5) distribution
+q <- c(0,0.4,1,2)
+# exact cdf
+pgamma(q/sqrt(5)+1,shape=5,scale=1/5)
+# use CLT
+pnorm(q)
+# use edgeworth expansion
+pCornishFisher(q,n=5,skew=2,ekurt=6)
+}
+}
+\author{
+ Eric Zivot and Yi-An Chen.
+}
+\references{
+ \itemize{ \item A.DasGupta, "Asymptotic Theory of
+ Statistics and Probability", Springer Science+Business
+ Media,LLC 2008 \item Thomas A.Severini, "Likelihood
+ Methods in Statistics", Oxford University Press, 2000 }
+}
+
Modified: pkg/FactorAnalytics/man/fitFundamentalFactorModel.Rd
===================================================================
--- pkg/FactorAnalytics/man/fitFundamentalFactorModel.Rd 2013-08-08 10:24:51 UTC (rev 2740)
+++ pkg/FactorAnalytics/man/fitFundamentalFactorModel.Rd 2013-08-08 17:52:59 UTC (rev 2741)
@@ -46,10 +46,10 @@
\item{standardized.factor.exposure}{logical flag. Factor
exposure will be standarized to regression weighted mean
- 0 and standardized deviation to 1 if \code(TRUE). Default
- is \code(FALSE). See Detail.}
+ 0 and standardized deviation to 1 if \code{TRUE}. Default
+ is \code{FALSE}. See Detail.}
- \item{weight.var.}{A character strping gives the name of
+ \item{weight.var}{A character strping gives the name of
the weight used for standarizing factor exposures.}
}
\value{
Deleted: pkg/FactorAnalytics/man/rCornishFisher.Rd
===================================================================
--- pkg/FactorAnalytics/man/rCornishFisher.Rd 2013-08-08 10:24:51 UTC (rev 2740)
+++ pkg/FactorAnalytics/man/rCornishFisher.Rd 2013-08-08 17:52:59 UTC (rev 2741)
@@ -1,77 +0,0 @@
-\name{rCornishFisher}
-\alias{dCornishFisher}
-\alias{pCornishFisher}
-\alias{qCornishFisher}
-\alias{rCornishFisher}
-\title{Functions for Cornish-Fisher density, CDF, random number simulation and
-quantile.}
-\usage{
- rCornishFisher(n, sigma, skew, ekurt, seed = NULL)
-}
-\arguments{
- \item{n}{scalar, number of simulated values in
- rCornishFisher. Sample length in
- density,distribution,quantile function.}
-
- \item{sigma}{scalar, standard deviation.}
-
- \item{skew}{scalar, skewness.}
-
- \item{ekurt}{scalar, excess kurtosis.}
-
- \item{seed}{set seed here. Default is \code{NULL}.}
-
- \item{x,q}{vector of standardized quantiles. See detail.}
-
- \item{p}{vector of probabilities.}
-}
-\value{
- n simulated values from Cornish-Fisher distribution.
-}
-\description{
- \itemize{ \item \code{rCornishFisher} simulate
- observations based on Cornish-Fisher quantile expansion
- given mean, standard deviation, skewness and excess
- kurtosis. \item \code{dCornishFisher} Computes
- Cornish-Fisher density from two term Edgeworth expansion
- given mean, standard deviation, skewness and excess
- kurtosis. \item \code{pCornishFisher} Computes
- Cornish-Fisher CDF from two term Edgeworth expansion
- given mean, standard deviation, skewness and excess
- kurtosis. \item \code{qCornishFisher} Computes
- Cornish-Fisher quantiles from two term Edgeworth
- expansion given mean, standard deviation, skewness and
- excess kurtosis. }
-}
-\details{
- CDF(q) = Pr(sqrt(n)*(x_bar-mu)/sigma < q)
-}
-\examples{
-# generate 1000 observation from Cornish-Fisher distribution
-rc <- rCornishFisher(1000,1,0,5)
-hist(rc,breaks=100,freq=FALSE,main="simulation of Cornish Fisher Distribution",
- xlim=c(-10,10))
-lines(seq(-10,10,0.1),dnorm(seq(-10,10,0.1),mean=0,sd=1),col=2)
-# compare with standard normal curve
-
-# example from A.dasGupta p.188 exponential example
-# x is iid exp(1) distribution, sample size = 5
-# then x_bar is Gamma(shape=5,scale=1/5) distribution
-q <- c(0,0.4,1,2)
-# exact cdf
-pgamma(q/sqrt(5)+1,shape=5,scale=1/5)
-# use CLT
-pnorm(q)
-# use edgeworth expansion
-pCornishFisher(q,n=5,skew=2,ekurt=6)
-}
-\author{
- Eric Zivot and Yi-An Chen.
-}
-\references{
- \itemize{ \item A.DasGupta, "Asymptotic Theory of
- Statistics and Probability", Springer Science+Business
- Media,LLC 2008 \item Thomas A.Severini, "Likelihood
- Methods in Statistics", Oxford University Press, 2000 }
-}
-
More information about the Returnanalytics-commits
mailing list