[Uwgarp-commits] r140 - in pkg/GARPFRM: demo man vignettes

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Mar 27 16:44:58 CET 2014


Author: rossbennett34
Date: 2014-03-27 16:44:57 +0100 (Thu, 27 Mar 2014)
New Revision: 140

Added:
   pkg/GARPFRM/man/consumption.Rd
   pkg/GARPFRM/man/fama_french_factors.Rd
   pkg/GARPFRM/man/largecap.ts.Rd
   pkg/GARPFRM/man/largecap_weekly.Rd
   pkg/GARPFRM/man/microcap.ts.Rd
   pkg/GARPFRM/man/microcap_weekly.Rd
   pkg/GARPFRM/man/midcap.ts.Rd
   pkg/GARPFRM/man/midcap_weekly.Rd
   pkg/GARPFRM/man/prices.Rd
   pkg/GARPFRM/man/returns.Rd
   pkg/GARPFRM/man/smallcap.ts.Rd
   pkg/GARPFRM/man/smallcap_weekly.Rd
Modified:
   pkg/GARPFRM/demo/00Index
   pkg/GARPFRM/vignettes/QuantitativeAnalysisBasics.Rnw
Log:
Adding documentation for data sets

Modified: pkg/GARPFRM/demo/00Index
===================================================================
--- pkg/GARPFRM/demo/00Index	2014-03-27 05:01:48 UTC (rev 139)
+++ pkg/GARPFRM/demo/00Index	2014-03-27 15:44:57 UTC (rev 140)
@@ -1,7 +1,7 @@
-bootstrap demonstrates using bootstrap method to estimate various statistics
-demo_CAPM demonstrate Capital Asset Pricing Model functions
-demo_EWMA_GARCH11 demonstrate exponentially weighted moving average and GARCH models
-EWMA demonstrate exponentially weighted moving average model
-monte_carlo demonstrate monte carlo method to simulate asset price paths
-univariate_GARCH demonstrate fitting a GARCH model to a univariate data set
-backtest_VaR demonstrate Value at Risk backtesting
+bootstrap demonstrates using bootstrap method to estimate various statistics.
+demo_CAPM demonstrate Capital Asset Pricing Model functions.
+demo_EWMA_GARCH11 demonstrate exponentially weighted moving average and GARCH models.
+EWMA demonstrate exponentially weighted moving average model.
+monte_carlo demonstrate monte carlo method to simulate asset price paths.
+univariate_GARCH demonstrate fitting a GARCH model to a univariate data set.
+backtest_VaR demonstrate Value at Risk backtesting.

Added: pkg/GARPFRM/man/consumption.Rd
===================================================================
--- pkg/GARPFRM/man/consumption.Rd	                        (rev 0)
+++ pkg/GARPFRM/man/consumption.Rd	2014-03-27 15:44:57 UTC (rev 140)
@@ -0,0 +1,57 @@
+\name{consumption}
+\docType{data}
+\alias{consumption}
+\title{consumption data}
+\description{
+Monthly consumption data of what?
+}
+\usage{consumption data}
+\details{
+Where did we get the consumption data?
+What are the details of the consumption data? Consumption of what?
+
+see \url{TODO}
+}
+\format{xts object with monthly observations}
+\source{\url{TODO}}
+\references{
+
+}
+\examples{
+data(crsp.short)
+head(largecap.ts)
+}
+\keyword{datasets}
+
+
+\name{z}
+\alias{z}
+\docType{data}
+\title{
+%%   ~~ data name/kind ... ~~
+}
+\description{
+%%  ~~ A concise (1-5 lines) description of the dataset. ~~
+}
+\usage{data(z)}
+\format{
+  A data frame with 0 observations on the following 2 variables.
+  \describe{
+    \item{\code{x}}{a numeric vector}
+    \item{\code{y}}{a numeric vector}
+  }
+}
+\details{
+%%  ~~ If necessary, more details than the __description__ above ~~
+}
+\source{
+%%  ~~ reference to a publication or URL from which the data were obtained ~~
+}
+\references{
+%%  ~~ possibly secondary sources and usages ~~
+}
+\examples{
+data(z)
+## maybe str(z) ; plot(z) ...
+}
+\keyword{datasets}

Added: pkg/GARPFRM/man/fama_french_factors.Rd
===================================================================
--- pkg/GARPFRM/man/fama_french_factors.Rd	                        (rev 0)
+++ pkg/GARPFRM/man/fama_french_factors.Rd	2014-03-27 15:44:57 UTC (rev 140)
@@ -0,0 +1,23 @@
+\name{fama_french_factors}
+\docType{data}
+\alias{fama_french_factors}
+\title{Factors for the Fama/French 3 factor model}
+\description{
+Weekly observations of Fama/French factors.
+}
+\usage{fama_french_factors}
+\details{
+see \url{http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/Data_Library/f-f_factors.html}
+}
+\format{xts object with weekly observations}
+\source{\url{http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html}}
+\references{
+
+}
+\examples{
+data(fama_french_factors)
+head(fama_french_factors)
+}
+\keyword{datasets}
+
+

Added: pkg/GARPFRM/man/largecap.ts.Rd
===================================================================
--- pkg/GARPFRM/man/largecap.ts.Rd	                        (rev 0)
+++ pkg/GARPFRM/man/largecap.ts.Rd	2014-03-27 15:44:57 UTC (rev 140)
@@ -0,0 +1,25 @@
+\name{largecap.ts}
+\docType{data}
+\alias{largecap.ts}
+\title{CRSP Large Cap Monthly Returns}
+\description{
+Monthly returns data of a selection of large cap stocks.
+}
+\usage{largecap.ts}
+\details{
+CRSP Data used in GARPFRM and related publications with the kind permission of the Center for Research in Security Prices.
+
+see \url{http://www.crsp.com/about-crsp}
+}
+\format{xts object with monthly observations}
+\source{\url{http://www.crsp.com}}
+\references{
+
+}
+\examples{
+data(crsp.short)
+head(largecap.ts)
+}
+\keyword{datasets}
+
+

Added: pkg/GARPFRM/man/largecap_weekly.Rd
===================================================================
--- pkg/GARPFRM/man/largecap_weekly.Rd	                        (rev 0)
+++ pkg/GARPFRM/man/largecap_weekly.Rd	2014-03-27 15:44:57 UTC (rev 140)
@@ -0,0 +1,25 @@
+\name{largecap_weekly}
+\docType{data}
+\alias{largecap_weekly}
+\title{CRSP Large Cap Weekly Returns}
+\description{
+Weekly returns data of a selection of large cap stocks.
+}
+\usage{largecap_weekly}
+\details{
+CRSP Data used in GARPFRM and related publications with the kind permission of the Center for Research in Security Prices.
+
+see \url{http://www.crsp.com/about-crsp}
+}
+\format{xts object with weekly observations}
+\source{\url{http://www.crsp.com}}
+\references{
+
+}
+\examples{
+data(crsp_weekly)
+head(largecap_weekly)
+}
+\keyword{datasets}
+
+

Added: pkg/GARPFRM/man/microcap.ts.Rd
===================================================================
--- pkg/GARPFRM/man/microcap.ts.Rd	                        (rev 0)
+++ pkg/GARPFRM/man/microcap.ts.Rd	2014-03-27 15:44:57 UTC (rev 140)
@@ -0,0 +1,25 @@
+\name{microcap.ts}
+\docType{data}
+\alias{microcap.ts}
+\title{CRSP Micro Cap Monthly Returns}
+\description{
+Monthly returns data of a selection of micro cap stocks.
+}
+\usage{microcap.ts}
+\details{
+CRSP Data used in GARPFRM and related publications with the kind permission of the Center for Research in Security Prices.
+
+see \url{http://www.crsp.com/about-crsp}
+}
+\format{xts object with monthly observations}
+\source{\url{http://www.crsp.com}}
+\references{
+
+}
+\examples{
+data(crsp.short)
+head(microcap.ts)
+}
+\keyword{datasets}
+
+

Added: pkg/GARPFRM/man/microcap_weekly.Rd
===================================================================
--- pkg/GARPFRM/man/microcap_weekly.Rd	                        (rev 0)
+++ pkg/GARPFRM/man/microcap_weekly.Rd	2014-03-27 15:44:57 UTC (rev 140)
@@ -0,0 +1,25 @@
+\name{microcap_weekly}
+\docType{data}
+\alias{microcap_weekly}
+\title{CRSP Micro Cap Weekly Returns}
+\description{
+Weekly returns data of a selection of large cap stocks.
+}
+\usage{microcap_weekly}
+\details{
+CRSP Data used in GARPFRM and related publications with the kind permission of the Center for Research in Security Prices.
+
+see \url{http://www.crsp.com/about-crsp}
+}
+\format{xts object with weekly observations}
+\source{\url{http://www.crsp.com}}
+\references{
+
+}
+\examples{
+data(crsp_weekly)
+head(microcap_weekly)
+}
+\keyword{datasets}
+
+

Added: pkg/GARPFRM/man/midcap.ts.Rd
===================================================================
--- pkg/GARPFRM/man/midcap.ts.Rd	                        (rev 0)
+++ pkg/GARPFRM/man/midcap.ts.Rd	2014-03-27 15:44:57 UTC (rev 140)
@@ -0,0 +1,25 @@
+\name{midcap.ts}
+\docType{data}
+\alias{midcap.ts}
+\title{CRSP Mid Cap Monthly Returns}
+\description{
+Monthly returns data of a selection of mid cap stocks.
+}
+\usage{midcap.ts}
+\details{
+CRSP Data used in GARPFRM and related publications with the kind permission of the Center for Research in Security Prices.
+
+see \url{http://www.crsp.com/about-crsp}
+}
+\format{xts object with monthly observations}
+\source{\url{http://www.crsp.com}}
+\references{
+
+}
+\examples{
+data(crsp.short)
+head(midcap.ts)
+}
+\keyword{datasets}
+
+

Added: pkg/GARPFRM/man/midcap_weekly.Rd
===================================================================
--- pkg/GARPFRM/man/midcap_weekly.Rd	                        (rev 0)
+++ pkg/GARPFRM/man/midcap_weekly.Rd	2014-03-27 15:44:57 UTC (rev 140)
@@ -0,0 +1,25 @@
+\name{midcap_weekly}
+\docType{data}
+\alias{midcap_weekly}
+\title{CRSP Mid Cap Weekly Returns}
+\description{
+Weekly returns data of a selection of large cap stocks.
+}
+\usage{midcap_weekly}
+\details{
+CRSP Data used in GARPFRM and related publications with the kind permission of the Center for Research in Security Prices.
+
+see \url{http://www.crsp.com/about-crsp}
+}
+\format{xts object with weekly observations}
+\source{\url{http://www.crsp.com}}
+\references{
+
+}
+\examples{
+data(crsp_weekly)
+head(midcap_weekly)
+}
+\keyword{datasets}
+
+

Added: pkg/GARPFRM/man/prices.Rd
===================================================================
--- pkg/GARPFRM/man/prices.Rd	                        (rev 0)
+++ pkg/GARPFRM/man/prices.Rd	2014-03-27 15:44:57 UTC (rev 140)
@@ -0,0 +1,24 @@
+\name{prices}
+\docType{data}
+\alias{prices}
+\title{Equity Prices}
+\description{
+Weekly observations of adjusted close prices for SPY, AAPL, XOM, GOOG, MSFT, and GE.
+}
+\usage{prices}
+\details{
+Data obtained via yahoo finance api.
+see \url{http://finance.yahoo.com}
+}
+\format{xts object with weekly observations}
+\source{\url{http://finance.yahoo.com}}
+\references{
+
+}
+\examples{
+data(prices)
+head(prices)
+}
+\keyword{datasets}
+
+

Added: pkg/GARPFRM/man/returns.Rd
===================================================================
--- pkg/GARPFRM/man/returns.Rd	                        (rev 0)
+++ pkg/GARPFRM/man/returns.Rd	2014-03-27 15:44:57 UTC (rev 140)
@@ -0,0 +1,24 @@
+\name{returns}
+\docType{data}
+\alias{returns}
+\title{Equity Returns}
+\description{
+Weekly observations of total returns for SPY, AAPL, XOM, GOOG, MSFT, and GE.
+}
+\usage{prices}
+\details{
+Data obtained via yahoo finance api.
+see \url{http://finance.yahoo.com}
+}
+\format{xts object with weekly observations}
+\source{\url{http://finance.yahoo.com}}
+\references{
+
+}
+\examples{
+data(returns)
+head(returns)
+}
+\keyword{datasets}
+
+

Added: pkg/GARPFRM/man/smallcap.ts.Rd
===================================================================
--- pkg/GARPFRM/man/smallcap.ts.Rd	                        (rev 0)
+++ pkg/GARPFRM/man/smallcap.ts.Rd	2014-03-27 15:44:57 UTC (rev 140)
@@ -0,0 +1,25 @@
+\name{smallcap.ts}
+\docType{data}
+\alias{smallcap.ts}
+\title{CRSP Small Cap Monthly Returns}
+\description{
+Monthly returns data of a selection of small cap stocks.
+}
+\usage{smallcap.ts}
+\details{
+CRSP Data used in GARPFRM and related publications with the kind permission of the Center for Research in Security Prices.
+
+see \url{http://www.crsp.com/about-crsp}
+}
+\format{xts object with monthly observations}
+\source{\url{http://www.crsp.com}}
+\references{
+
+}
+\examples{
+data(crsp.short)
+head(smallcap.ts)
+}
+\keyword{datasets}
+
+

Added: pkg/GARPFRM/man/smallcap_weekly.Rd
===================================================================
--- pkg/GARPFRM/man/smallcap_weekly.Rd	                        (rev 0)
+++ pkg/GARPFRM/man/smallcap_weekly.Rd	2014-03-27 15:44:57 UTC (rev 140)
@@ -0,0 +1,25 @@
+\name{smallcap_weekly}
+\docType{data}
+\alias{smallcap_weekly}
+\title{CRSP Small Cap Weekly Returns}
+\description{
+Weekly returns data of a selection of large cap stocks.
+}
+\usage{smallcap_weekly}
+\details{
+CRSP Data used in GARPFRM and related publications with the kind permission of the Center for Research in Security Prices.
+
+see \url{http://www.crsp.com/about-crsp}
+}
+\format{xts object with weekly observations}
+\source{\url{http://www.crsp.com}}
+\references{
+
+}
+\examples{
+data(crsp_weekly)
+head(smallcap_weekly)
+}
+\keyword{datasets}
+
+

Modified: pkg/GARPFRM/vignettes/QuantitativeAnalysisBasics.Rnw
===================================================================
--- pkg/GARPFRM/vignettes/QuantitativeAnalysisBasics.Rnw	2014-03-27 05:01:48 UTC (rev 139)
+++ pkg/GARPFRM/vignettes/QuantitativeAnalysisBasics.Rnw	2014-03-27 15:44:57 UTC (rev 140)
@@ -82,7 +82,7 @@
 @
 
 
-Plot of the MKT weekly returns. 
+Plot of the MKT monthly returns. 
 <<>>=
 plot(MKT.ret, main="Market Monthly Returns")
 @
@@ -158,7 +158,7 @@
 quantile(MKT.ret, probs=c(0, 0.25, 0.5, 0.75, 1))
 @
 
-Scatter plot of each pair of assets. This can be usefule to visually look for relationships among the assets.
+Scatter plot of each pair of assets. This can be useful to visually look for relationships among the assets.
 <<tidy=FALSE>>=
 pairs(coredata(crsp.returns), pch=20, col=rgb(0,0,100,50,maxColorValue=255))
 hexplom(coredata(crsp.returns), varname.cex=0.75)
@@ -171,7 +171,8 @@
 @
 
 <<echo=FALSE>>=
-suppressWarnings(plotcov(cor(crsp.returns), method1="Sample Correlation Estimate"))
+suppressWarnings(plotcov(cor(crsp.returns), 
+                         method1="Sample Correlation Estimate"))
 @
 
 <<>>=
@@ -180,7 +181,8 @@
 @
 
 <<echo=FALSE>>=
-suppressWarnings(plotcov(cov(crsp.returns), method1="Sample Covariance Estimate"))
+suppressWarnings(plotcov(cov(crsp.returns), 
+                         method1="Sample Covariance Estimate"))
 @
 
 
@@ -201,7 +203,7 @@
 \item d*: density
 \item p*: distribution function (probability)
 \item q*: quantile function
-\item r*: random generation
+\item r*: random number generation
 \end{itemize}
 where * is the appropriate distribution.
 
@@ -314,11 +316,11 @@
 # Coefficients
 coef(model.fit)
 # Extract the fitted values
-# fitted(model.fit)
+head(fitted(model.fit))
 # Extract the residuals
-# resid(model.fit)
+head(resid(model.fit))
 # Exctract the standardized residuals
-# rstandard(model.fit)
+head(rstandard(model.fit))
 @
 
 Access elements of the \verb"lm.summary" object
@@ -473,8 +475,8 @@
 If we wanted to fit the model to more assets, we could manually fit the model with different assets as the response variable. However, we can automatically fit several models very easily with R.
 
 <<>>=
-# Omit the first column of returns because it is the SPY weekly returns, which is
-# a proxy for the market.
+# Omit the first column of returns because it is the SPY weekly returns, 
+# which is a proxy for the market.
 returns <- returns[, -1]
 
 # Calculate the excess returns of all assets in the returns object



More information about the Uwgarp-commits mailing list