[Uwgarp-commits] r173 - in pkg/GARPFRM: . R man sandbox

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jun 9 22:00:04 CEST 2014


Author: tfillebeen
Date: 2014-06-09 22:00:03 +0200 (Mon, 09 Jun 2014)
New Revision: 173

Added:
   pkg/GARPFRM/R/discountFactorArbitrage.R
   pkg/GARPFRM/R/riskMetricsAndHedges.R
   pkg/GARPFRM/sandbox/principleComponent.R
   pkg/GARPFRM/sandbox/test_discountFactorArbitrage.R
Modified:
   pkg/GARPFRM/DESCRIPTION
   pkg/GARPFRM/NAMESPACE
   pkg/GARPFRM/man/CAPM.Rd
   pkg/GARPFRM/man/EWMA.Rd
   pkg/GARPFRM/man/backTestVaR.Rd
   pkg/GARPFRM/man/backtestVaR.GARCH.Rd
   pkg/GARPFRM/man/bootCor.Rd
   pkg/GARPFRM/man/bootCov.Rd
   pkg/GARPFRM/man/bootES.Rd
   pkg/GARPFRM/man/bootFUN.Rd
   pkg/GARPFRM/man/bootMean.Rd
   pkg/GARPFRM/man/bootSD.Rd
   pkg/GARPFRM/man/bootSimpleVolatility.Rd
   pkg/GARPFRM/man/bootStdDev.Rd
   pkg/GARPFRM/man/bootVaR.Rd
   pkg/GARPFRM/man/chartSML.Rd
   pkg/GARPFRM/man/efficientFrontier.Rd
   pkg/GARPFRM/man/efficientFrontierTwoAsset.Rd
   pkg/GARPFRM/man/endingPrices.Rd
   pkg/GARPFRM/man/estimateLambdaCor.Rd
   pkg/GARPFRM/man/estimateLambdaCov.Rd
   pkg/GARPFRM/man/estimateLambdaVol.Rd
   pkg/GARPFRM/man/forecast.Rd
   pkg/GARPFRM/man/forecast.uvEWMAvol.Rd
   pkg/GARPFRM/man/forecast.uvGARCH.Rd
   pkg/GARPFRM/man/getAlphas.Rd
   pkg/GARPFRM/man/getBetas.Rd
   pkg/GARPFRM/man/getCor.Rd
   pkg/GARPFRM/man/getCov.Rd
   pkg/GARPFRM/man/getEstimate.Rd
   pkg/GARPFRM/man/getFit.Rd
   pkg/GARPFRM/man/getSpec.Rd
   pkg/GARPFRM/man/getStatistics.Rd
   pkg/GARPFRM/man/getVaREstimates.Rd
   pkg/GARPFRM/man/getVaRViolations.Rd
   pkg/GARPFRM/man/hypTest.Rd
   pkg/GARPFRM/man/minVarPortfolio.Rd
   pkg/GARPFRM/man/monteCarlo.Rd
   pkg/GARPFRM/man/plot.EWMA.Rd
   pkg/GARPFRM/man/plot.backtestVaR.Rd
   pkg/GARPFRM/man/plot.capm_mlm.Rd
   pkg/GARPFRM/man/plot.capm_uv.Rd
   pkg/GARPFRM/man/plot.efTwoAsset.Rd
   pkg/GARPFRM/man/plot.efficient.frontier.Rd
   pkg/GARPFRM/man/plot.uvGARCH.Rd
   pkg/GARPFRM/man/plotEndingPrices.Rd
   pkg/GARPFRM/man/portReturnTwoAsset.Rd
   pkg/GARPFRM/man/portSDTwoAsset.Rd
   pkg/GARPFRM/man/realizedCor.Rd
   pkg/GARPFRM/man/realizedCov.Rd
   pkg/GARPFRM/man/realizedVol.Rd
   pkg/GARPFRM/man/rollCor.Rd
   pkg/GARPFRM/man/rollCov.Rd
   pkg/GARPFRM/man/rollSD.Rd
   pkg/GARPFRM/man/rollSimpleVolatility.Rd
   pkg/GARPFRM/man/simpleVolatility.Rd
   pkg/GARPFRM/man/tangentPortfolio.Rd
   pkg/GARPFRM/man/uvGARCH.Rd
Log:
bond tests and functions + PCA, missing duration,convexity and lienar hedge. Also term structure has a mistake

Modified: pkg/GARPFRM/DESCRIPTION
===================================================================
--- pkg/GARPFRM/DESCRIPTION	2014-04-26 23:56:28 UTC (rev 172)
+++ pkg/GARPFRM/DESCRIPTION	2014-06-09 20:00:03 UTC (rev 173)
@@ -17,15 +17,3 @@
     PortfolioAnalytics (>= 0.9.0)
 License: GPL
 BuildVignettes: false
-Collate:
-    'backTestVaR.R'
-    'capm.R'
-    'EWMA.R'
-    'garch11.R'
-    'monte_carlo.R'
-    'efficient_frontier.R'
-    'rollFUN.R'
-    'volatility.R'
-    'boot.R'
-    'utils.R'
-    'generic_forecast.R'

Modified: pkg/GARPFRM/NAMESPACE
===================================================================
--- pkg/GARPFRM/NAMESPACE	2014-04-26 23:56:28 UTC (rev 172)
+++ pkg/GARPFRM/NAMESPACE	2014-06-09 20:00:03 UTC (rev 173)
@@ -1,5 +1,36 @@
+S3method(forecast,uvEWMAvol)
+S3method(forecast,uvGARCH)
+S3method(getAlphas,capm_mlm)
+S3method(getAlphas,capm_uv)
+S3method(getBetas,capm_mlm)
+S3method(getBetas,capm_uv)
+S3method(getCor,mvEWMAcor)
+S3method(getCov,mvEWMAcov)
+S3method(getEstimate,EWMA)
+S3method(getEstimate,mvEWMAvol)
+S3method(getFit,uvGARCH)
+S3method(getSpec,uvGARCH)
+S3method(getStatistics,capm_mlm)
+S3method(getStatistics,capm_uv)
+S3method(hypTest,capm_mlm)
+S3method(hypTest,capm_uv)
+S3method(plot,EWMA)
+S3method(plot,MonteCarlo)
+S3method(plot,backtestVaR)
+S3method(plot,capm_mlm)
+S3method(plot,capm_uv)
+S3method(plot,efTwoAsset)
+S3method(plot,efficient.frontier)
+S3method(print,EWMA)
+S3method(print,backtestVaR)
+S3method(print,mvEWMAvol)
+export(CAPM)
+export(EWMA)
+export(backtestVaR)
 export(backtestVaR.GARCH)
-export(backtestVaR)
+export(bondFullPrice)
+export(bondPrice)
+export(bondSpec)
 export(bootCor)
 export(bootCov)
 export(bootES)
@@ -9,15 +40,15 @@
 export(bootSimpleVolatility)
 export(bootStdDev)
 export(bootVaR)
-export(CAPM)
 export(chartSML)
+export(compoundingRate)
+export(discountFactor)
 export(efficientFrontier)
 export(efficientFrontierTwoAsset)
 export(endingPrices)
 export(estimateLambdaCor)
 export(estimateLambdaCov)
 export(estimateLambdaVol)
-export(EWMA)
 export(forecast)
 export(getAlphas)
 export(getBetas)
@@ -30,6 +61,7 @@
 export(getVaREstimates)
 export(getVaRViolations)
 export(hypTest)
+export(is.bond)
 export(minVarPortfolio)
 export(monteCarlo)
 export(plotEndingPrices)
@@ -45,29 +77,3 @@
 export(simpleVolatility)
 export(tangentPortfolio)
 export(uvGARCH)
-S3method(forecast,uvEWMAvol)
-S3method(forecast,uvGARCH)
-S3method(getAlphas,capm_mlm)
-S3method(getAlphas,capm_uv)
-S3method(getBetas,capm_mlm)
-S3method(getBetas,capm_uv)
-S3method(getCor,mvEWMAcor)
-S3method(getCov,mvEWMAcov)
-S3method(getEstimate,EWMA)
-S3method(getEstimate,mvEWMAvol)
-S3method(getFit,uvGARCH)
-S3method(getSpec,uvGARCH)
-S3method(getStatistics,capm_mlm)
-S3method(getStatistics,capm_uv)
-S3method(hypTest,capm_mlm)
-S3method(hypTest,capm_uv)
-S3method(plot,backtestVaR)
-S3method(plot,capm_mlm)
-S3method(plot,capm_uv)
-S3method(plot,efficient.frontier)
-S3method(plot,efTwoAsset)
-S3method(plot,EWMA)
-S3method(plot,MonteCarlo)
-S3method(print,backtestVaR)
-S3method(print,EWMA)
-S3method(print,mvEWMAvol)

Added: pkg/GARPFRM/R/discountFactorArbitrage.R
===================================================================
--- pkg/GARPFRM/R/discountFactorArbitrage.R	                        (rev 0)
+++ pkg/GARPFRM/R/discountFactorArbitrage.R	2014-06-09 20:00:03 UTC (rev 173)
@@ -0,0 +1,185 @@
+# Ch 6 Prices, Discount Factors, and Arbitrage (Law of one Price)
+# The Cash Flows from Fixed-Rate Government Coupon Bonds, Discount Faors, Law of One Price
+# Arbitrage opportunity: trade that generates profits without any chance of losing money.
+# If there is a deviation from the law of one price, there exists an arbitrage opportunity.
+# In order to estimate the discount factor for a particular term gives the value today, 
+# or the present alue of one unit of currency to be received at the end of that term.(Pg.129)
+
+#' Constructor for bond specification
+#' 
+#' Created a bond object \code{bond.spec} with data for bond specification.
+#' 
+#' @param time vector of sequence of coupon payments in years
+#' @param face face value of bond
+#' @param m compounding frequency
+#' @param couponRate rate the coupon pays
+#' @return a \code{bond} object with the bond data used for pricing
+#' @author TF
+#' @export
+bondSpec = function(time, face=100, m=2, couponRate=0.01){
+  if(!all(diff(time) == (1/m))) stop("misspecification of sequence of time and compounding frequency")
+  bond = list()
+  bond$m = m
+  bond$couponRate = couponRate
+  bond$face = face
+  bond$time = time
+  class(bond) = c("bond.spec", "bond")
+  return(bond)
+}
+
+#' To determine if user is specifying bond parameters correctly
+#' 
+#' @param object a capm object created by \code{\link{bond.spec}}
+#' @author TF
+#' @export
+is.bond = function(object){
+  inherits(object, "bond.spec")
+}
+
+#' Estimate price of bond
+#' 
+#' This function calculates the price of a fixed rate coupon bond given the 
+#' discount curve and bond data. First it converts the discountCurve into CF
+#' @param bond a \code{discountFactorArbitrage} object
+#' @param discountCurve vector of discount rates
+#' @return price of the bond
+#' @author TF
+#' @export
+bondPrice = function(bond, discountCurve){
+  if(!is.bond(bond)) stop("bond must be an object of class 'bond'")
+  # Number of periods in discount curve
+  nDC <- length(discountCurve)
+  m <- bond$m
+  couponRate <- bond$couponRate
+  face <- bond$face
+  time <- bond$time
+  
+  couponAmount <- face * couponRate / m
+  cashflows <- rep(couponAmount, nDC)
+  cashflows[nDC] <- couponAmount + face
+  price <- sum(cashflows * discountCurve)
+  return(price)
+}
+
+#' Estimate discountFactor
+#' 
+#' This function calculates the discountFactor (DF) given price 
+#' and cashFlows.
+#' @param bond a \code{discountFactorArbitrage} object
+#' @param price  of a bond
+#' @return cashFlow of a bond
+#' @author TF
+#' @export
+discountFactor = function(price, cashFlow){
+  DF = solve(cashFlow) %*% price
+  return(DF)
+}
+
+#' Estimate price of bond w/ acrrued interest
+#' 
+#' This function calculates the price of a fixed rate coupon bond given coupon rate, yield, 
+#' compoundPd, cashFlowPd, face value, previous coupon date, next coupon date.
+#' @param couponRate is the coupon rate
+#' @param yield is the yield on the bond
+#' @param compoundPd coumpounding period
+#' @param cashFlowPd cash flow period
+#' @param face face value
+#' @param t0 previous coupon date
+#' @param t1 next coupon period
+#' @param currentDate current date
+#' @return price of the bond: clean, dirty and accrued interest
+#' @author TF
+#' @export
+bondFullPrice = function(couponRate, yield, compoundPd, cashFlowPd, face=100, t0, t1, currentDate){
+  # Apply a general dayCount (weekend included)
+  d1 = as.numeric(t1-currentDate)
+  d2 = as.numeric(t1-t0)
+  # Initialize
+  tmp = 0 
+  for(k in 1:(cashFlowPd-1)){
+    tmp = tmp + ((couponRate / compoundPd * face) / ((1 + yield/compoundPd)^k))
+  }
+  # Calculate dirty price based on partial periods formula
+  dirtyP = (1 / ((1 + yield / compoundPd)^(d1/d2))) * (couponRate / compoundPd * face + tmp + face / ((1 + yield/compoundPd)^(cashFlowPd-1)))
+  # Calculate accruedInterest
+  aiDays = as.numeric(currentDate-t0)
+  couponDays = as.numeric(t1-t0)
+  ai = couponRate / compoundPd * face * aiDays / couponDays
+  cleanP = dirtyP - ai
+  return(list(dirty=dirtyP, clean=cleanP, accruedInterest=ai))
+}
+
+#' Estimate continuously conpounding rate to be used in term structure
+#' 
+#' This function calculates the continuously compounding rate given an initial dataset 
+#' with specific format, date of reference coumpounding frequency, and face value
+#' @param dat is a dataset with cusip, issueDate, MaturityDate, Name, Coupon, Bid/Ask
+#' @param intialDate is the date when the estimation should be conducted: date of reference
+#' @param m compounding frequency
+#' @param face face value
+#' @return continuously compounding rates
+#' @author TF
+#' @export
+compoundingRate = function(dat, initialDate=as.Date("2000-05-15"), m, face=100){
+  # Convert the dates to a date class
+  dat[, "IssueDate"] = as.Date(dat[, "IssueDate"], format="%m/%d/%Y")
+  dat[, "MaturityDate"] = as.Date(dat[, "MaturityDate"], format="%m/%d/%Y")
+  # Convert the coupon column to a numeric
+  dat[, "Coupon"] = as.numeric(gsub("%", "", dat[, "Coupon"])) / 100
+  # Vector of prices
+  price = (dat[, "Bid"] + dat[, "Ask"]) / 2
+  
+  # Generate cash flow dates for each bond
+  bondData = list()
+  for(i in 1:nrow(dat)){
+    maturityDate = dat[i, "MaturityDate"]
+    # Intialize a new list for every price, coupon, coupon date.
+    bondData[[i]] = list()
+    # Store price and the number of the coupon
+    bondData[[i]]$price = price[i]
+    bondData[[i]]$coupon = dat[i, "Coupon"]
+    # Remove initialDate
+    tmpSeq <- seq(from=initialDate, to=maturityDate, by="3 months")
+    bondData[[i]]$couponDates = tmpSeq[-1]
+    tmpDates = bondData[[i]]$couponDates
+    tmpCoupons = vector("numeric", length(tmpDates))
+    for(j in 1:length(tmpDates)){
+      tmpCoupons[j] = bondData[[i]]$coupon / m * face
+      if(j == length(tmpDates)){
+        tmpCoupons[j] = face + bondData[[i]]$coupon / m * face
+      }
+    }
+    bondData[[i]]$cashFlow = tmpCoupons
+  }
+  # Create a matrix of cash flows
+  CF = matrix(0, length(price), length(price))
+  # Populate the CF matrix
+  for(i in 1:nrow(CF)){
+    tmp = bondData[[i]]$cashFlow
+    index = 1:length(tmp)
+    CF[i, index] = tmp
+  }
+  # Utilize the discountFactor function
+  DF = discountFactor(price,CF)
+
+  dates = bondData[[nrow(dat)]]$couponDates
+  years = vector("numeric", length(dates))
+  for(i in 1:length(years)){
+    years[i] = (as.numeric(strftime(dates[i], "%Y")) + as.numeric(strftime(dates[i], "%m"))/12) - (as.numeric(strftime(initialDate, "%Y")) + as.numeric(strftime(initialDate, "%m"))/12)
+  }
+  # Calculate continuously compounded rates from discount factors
+  ccRate = vector("numeric", length(years))
+  for(i in 1:length(ccRate)){
+    ccRate[i] = - log(DF[i]) / years[i]
+  }
+  rate = list()
+  rate$years = years
+  rate$ccRate = ccRate 
+  return(rate)
+}
+
+
+## Plot of continuously compounded spot rates
+#plot(x=years, y=ccRate, type="l", ylab="rate", xlab="Time to Maturity",
+#     main="Term Structure of Spot Rates")
+#dev.off()

Added: pkg/GARPFRM/R/riskMetricsAndHedges.R
===================================================================
--- pkg/GARPFRM/R/riskMetricsAndHedges.R	                        (rev 0)
+++ pkg/GARPFRM/R/riskMetricsAndHedges.R	2014-06-09 20:00:03 UTC (rev 173)
@@ -0,0 +1,4 @@
+# Convexity and Duration
+
+# linear hedge
+

Modified: pkg/GARPFRM/man/CAPM.Rd
===================================================================
--- pkg/GARPFRM/man/CAPM.Rd	2014-04-26 23:56:28 UTC (rev 172)
+++ pkg/GARPFRM/man/CAPM.Rd	2014-06-09 20:00:03 UTC (rev 173)
@@ -2,7 +2,7 @@
 \alias{CAPM}
 \title{Capital Asset Pricing Model}
 \usage{
-  CAPM(R, Rmkt)
+CAPM(R, Rmkt)
 }
 \arguments{
   \item{R}{asset returns}
@@ -10,13 +10,13 @@
   \item{Rmkt}{market returns}
 }
 \description{
-  CAPM describes the relationship between risk and
-  (expected) return
+CAPM describes the relationship between risk and (expected)
+return
 }
 \details{
-  Retrieves alphas, betas, as well as pvalue and tstats.
-  The CAPM is used to determine a theoretically appropriate
-  rate of return of the non-diversifiable risk of an asset.
+Retrieves alphas, betas, as well as pvalue and tstats. The
+CAPM is used to determine a theoretically appropriate rate
+of return of the non-diversifiable risk of an asset.
 }
 \examples{
 data(crsp.short)
@@ -31,6 +31,6 @@
 tmp <- CAPM(R=R, Rmkt=MKT)
 }
 \author{
-  Thomas Fillebeen
+Thomas Fillebeen
 }
 

Modified: pkg/GARPFRM/man/EWMA.Rd
===================================================================
--- pkg/GARPFRM/man/EWMA.Rd	2014-04-26 23:56:28 UTC (rev 172)
+++ pkg/GARPFRM/man/EWMA.Rd	2014-06-09 20:00:03 UTC (rev 173)
@@ -2,8 +2,8 @@
 \alias{EWMA}
 \title{EWMA Model}
 \usage{
-  EWMA(R, lambda = 0.94, initialWindow = 10, n = 10,
-    type = c("volatility", "covariance", "correlation"))
+EWMA(R, lambda = 0.94, initialWindow = 10, n = 10,
+  type = c("volatility", "covariance", "correlation"))
 }
 \arguments{
   \item{R}{xts object of asset returns}
@@ -23,21 +23,21 @@
   correlation.}
 }
 \value{
-  an EWMA object with the following elements \itemize{
-  \item \code{estimate} EWMA model estimated statistic
-  \item \code{model} list with model parameters \item
-  \code{data} list with original returns data and realized
-  statistic if applicable }
+an EWMA object with the following elements \itemize{ \item
+\code{estimate} EWMA model estimated statistic \item
+\code{model} list with model parameters \item \code{data}
+list with original returns data and realized statistic if
+applicable }
 }
 \description{
-  EWMA model to estimate volatility, covariance, and
-  correlation
+EWMA model to estimate volatility, covariance, and
+correlation
 }
 \details{
-  If lambda=NULL, the lambda value can be estimated for
-  univariate estimates of volatility, covariance, and
-  correlation by minimizing the mean squared error between
-  the estimated value and realized value.
+If lambda=NULL, the lambda value can be estimated for
+univariate estimates of volatility, covariance, and
+correlation by minimizing the mean squared error between
+the estimated value and realized value.
 }
 \examples{
 # data and parameters for EWMA estimate
@@ -78,6 +78,6 @@
 cor_mv
 }
 \author{
-  Ross Bennett and Thomas Fillebeen
+Ross Bennett and Thomas Fillebeen
 }
 

Modified: pkg/GARPFRM/man/backTestVaR.Rd
===================================================================
--- pkg/GARPFRM/man/backTestVaR.Rd	2014-04-26 23:56:28 UTC (rev 172)
+++ pkg/GARPFRM/man/backTestVaR.Rd	2014-06-09 20:00:03 UTC (rev 173)
@@ -2,9 +2,8 @@
 \alias{backtestVaR}
 \title{Backtest Value-at-Risk (VaR)}
 \usage{
-  backtestVaR(R, window = 100, p = 0.95,
-    method = "historical", bootstrap = FALSE,
-    replications = 1000, bootParallel = FALSE)
+backtestVaR(R, window = 100, p = 0.95, method = "historical",
+  bootstrap = FALSE, replications = 1000, bootParallel = FALSE)
 }
 \arguments{
   \item{R}{xts or zoo object of asset returns}
@@ -27,13 +26,12 @@
   parallel, (default FALSE).}
 }
 \description{
-  Backtesting Value-at-Risk estimate over a moving window.
+Backtesting Value-at-Risk estimate over a moving window.
 }
 \details{
-  The size of the moving window is set with the
-  \code{window} argument. For example, if the window size
-  is 100, periods 1:100 are used to estimate the VaR level
-  for period 101.
+The size of the moving window is set with the \code{window}
+argument. For example, if the window size is 100, periods
+1:100 are used to estimate the VaR level for period 101.
 }
 \examples{
 data(crsp_weekly)
@@ -45,10 +43,10 @@
 head(getVaRViolations(backtest))
 }
 \author{
-  Ross Bennett
+Ross Bennett
 }
 \seealso{
-  \code{\link[PerformanceAnalytics]{VaR}},
-  \code{\link{bootVaR}}
+\code{\link[PerformanceAnalytics]{VaR}},
+\code{\link{bootVaR}}
 }
 

Modified: pkg/GARPFRM/man/backtestVaR.GARCH.Rd
===================================================================
--- pkg/GARPFRM/man/backtestVaR.GARCH.Rd	2014-04-26 23:56:28 UTC (rev 172)
+++ pkg/GARPFRM/man/backtestVaR.GARCH.Rd	2014-06-09 20:00:03 UTC (rev 173)
@@ -2,8 +2,8 @@
 \alias{backtestVaR.GARCH}
 \title{GARCH Model VaR Backtest}
 \usage{
-  backtestVaR.GARCH(garch, p = c(0.95, 0.99), nAhead = 1,
-    refitEvery = 25, window = 100)
+backtestVaR.GARCH(garch, p = c(0.95, 0.99), nAhead = 1, refitEvery = 25,
+  window = 100)
 }
 \arguments{
   \item{garch}{uvGARCH object create via
@@ -20,13 +20,13 @@
   VaR estimate.}
 }
 \description{
-  Function for rolling estimate of GARCH model and VaR
-  backtest
+Function for rolling estimate of GARCH model and VaR
+backtest
 }
 \author{
-  Ross Bennett
+Ross Bennett
 }
 \seealso{
-  \code{\link[rugarch]{ugarchroll}}
+\code{\link[rugarch]{ugarchroll}}
 }
 

Modified: pkg/GARPFRM/man/bootCor.Rd
===================================================================
--- pkg/GARPFRM/man/bootCor.Rd	2014-04-26 23:56:28 UTC (rev 172)
+++ pkg/GARPFRM/man/bootCor.Rd	2014-06-09 20:00:03 UTC (rev 173)
@@ -2,7 +2,7 @@
 \alias{bootCor}
 \title{Bootstrap Correlation}
 \usage{
-  bootCor(R, ..., replications = 1000)
+bootCor(R, ..., replications = 1000)
 }
 \arguments{
   \item{R}{xts object or matrix of asset returns}
@@ -13,8 +13,8 @@
   \item{replications}{number of bootstrap replications.}
 }
 \description{
-  Bootstrap the correlation of an xts object or matrix of
-  asset returns
+Bootstrap the correlation of an xts object or matrix of
+asset returns
 }
 \examples{
 data(crsp_weekly)
@@ -24,9 +24,9 @@
 bootCor(R)
 }
 \author{
-  Ross Bennett
+Ross Bennett
 }
 \seealso{
-  \code{\link[stats]{cor}}
+\code{\link[stats]{cor}}
 }
 

Modified: pkg/GARPFRM/man/bootCov.Rd
===================================================================
--- pkg/GARPFRM/man/bootCov.Rd	2014-04-26 23:56:28 UTC (rev 172)
+++ pkg/GARPFRM/man/bootCov.Rd	2014-06-09 20:00:03 UTC (rev 173)
@@ -2,7 +2,7 @@
 \alias{bootCov}
 \title{Bootstrap Covariance}
 \usage{
-  bootCov(R, ..., replications = 1000)
+bootCov(R, ..., replications = 1000)
 }
 \arguments{
   \item{R}{xts object or matrix of asset returns}
@@ -13,8 +13,8 @@
   \item{replications}{number of bootstrap replications.}
 }
 \description{
-  Bootstrap the covariance of an xts object or matrix of
-  asset returns
+Bootstrap the covariance of an xts object or matrix of
+asset returns
 }
 \examples{
 data(crsp_weekly)
@@ -23,9 +23,9 @@
 bootCov(R)
 }
 \author{
-  Ross Bennett
+Ross Bennett
 }
 \seealso{
-  \code{\link[stats]{cov}}
+\code{\link[stats]{cov}}
 }
 

Modified: pkg/GARPFRM/man/bootES.Rd
===================================================================
--- pkg/GARPFRM/man/bootES.Rd	2014-04-26 23:56:28 UTC (rev 172)
+++ pkg/GARPFRM/man/bootES.Rd	2014-06-09 20:00:03 UTC (rev 173)
@@ -2,7 +2,7 @@
 \alias{bootES}
 \title{Bootstrap Expected Shortfall}
 \usage{
-  bootES(R, ..., replications = 1000)
+bootES(R, ..., replications = 1000)
 }
 \arguments{
   \item{R}{xts object or matrix of asset returns}
@@ -13,8 +13,8 @@
   \item{replications}{number of bootstrap replications.}
 }
 \description{
-  Bootstrap the Expected Shortfall (ES) of an xts object or
-  matrix of asset returns
+Bootstrap the Expected Shortfall (ES) of an xts object or
+matrix of asset returns
 }
 \examples{
 data(crsp_weekly)
@@ -24,9 +24,9 @@
 bootVaR(R, p=0.9, method="historical", invert=FALSE)
 }
 \author{
-  Ross Bennett
+Ross Bennett
 }
 \seealso{
-  \code{\link[PerformanceAnalytics]{ES}}
+\code{\link[PerformanceAnalytics]{ES}}
 }
 

Modified: pkg/GARPFRM/man/bootFUN.Rd
===================================================================
--- pkg/GARPFRM/man/bootFUN.Rd	2014-04-26 23:56:28 UTC (rev 172)
+++ pkg/GARPFRM/man/bootFUN.Rd	2014-06-09 20:00:03 UTC (rev 173)
@@ -2,7 +2,7 @@
 \alias{bootFUN}
 \title{Bootstrap}
 \usage{
-  bootFUN(R, FUN = "mean", ..., replications = 1000)
+bootFUN(R, FUN = "mean", ..., replications = 1000)
 }
 \arguments{
   \item{R}{xts object or matrix of data passed to
@@ -15,28 +15,27 @@
   \item{replications}{number of bootstrap replications.}
 }
 \description{
-  Bootstrap a function
+Bootstrap a function
 }
 \details{
-  \code{R} is the data passed to \code{FUN}. \code{FUN}
-  must have \code{x} or \code{R} as arguments for the data.
-  For example, see the functions linked to in the 'See
-  Also' section. Care must be taken when using
-  \code{bootFUN} on multivariate data. This function is
-  designed to only accept univariate (i.e. ncol(R) = 1)
-  data, however is made to work with bivariate data for
-  \code{bootCor} and \code{bootCov}. For multivariate data,
-  a wrapper function should be written to apply the
-  bootstrap function to each column of data.
+\code{R} is the data passed to \code{FUN}. \code{FUN} must
+have \code{x} or \code{R} as arguments for the data. For
+example, see the functions linked to in the 'See Also'
+section. Care must be taken when using \code{bootFUN} on
+multivariate data. This function is designed to only accept
+univariate (i.e. ncol(R) = 1) data, however is made to work
+with bivariate data for \code{bootCor} and \code{bootCov}.
+For multivariate data, a wrapper function should be written
+to apply the bootstrap function to each column of data.
 }
 \author{
-  Ross Bennett
+Ross Bennett
 }
 \seealso{
-  \code{\link{bootMean}}, \code{\link{bootSD}},
-  \code{\link{bootStdDev}},
-  \code{\link{bootSimpleVolatility}},
-  \code{\link{bootCor}}, \code{\link{bootCov}},
-  \code{\link{bootVaR}}, \code{\link{bootES}}
+\code{\link{bootMean}}, \code{\link{bootSD}},
+\code{\link{bootStdDev}},
+\code{\link{bootSimpleVolatility}}, \code{\link{bootCor}},
+\code{\link{bootCov}}, \code{\link{bootVaR}},
+\code{\link{bootES}}
 }
 

Modified: pkg/GARPFRM/man/bootMean.Rd
===================================================================
--- pkg/GARPFRM/man/bootMean.Rd	2014-04-26 23:56:28 UTC (rev 172)
+++ pkg/GARPFRM/man/bootMean.Rd	2014-06-09 20:00:03 UTC (rev 173)
@@ -2,7 +2,7 @@
 \alias{bootMean}
 \title{Bootstrap Mean}
 \usage{
-  bootMean(R, ..., replications = 1000)
+bootMean(R, ..., replications = 1000)
 }
 \arguments{
   \item{R}{xts object or matrix of asset returns}
@@ -13,8 +13,8 @@
   \item{replications}{number of bootstrap replications.}
 }
 \description{
-  Bootstrap the mean of an xts object or matrix of asset
-  returns
+Bootstrap the mean of an xts object or matrix of asset
+returns
 }
 \examples{
 data(crsp_weekly)
@@ -23,9 +23,9 @@
 bootMean(R)
 }
 \author{
-  Ross Bennett
+Ross Bennett
 }
 \seealso{
-  \code{\link[base]{mean}}
+\code{\link[base]{mean}}
 }
 

Modified: pkg/GARPFRM/man/bootSD.Rd
===================================================================
--- pkg/GARPFRM/man/bootSD.Rd	2014-04-26 23:56:28 UTC (rev 172)
+++ pkg/GARPFRM/man/bootSD.Rd	2014-06-09 20:00:03 UTC (rev 173)
@@ -2,7 +2,7 @@
 \alias{bootSD}
 \title{Bootstrap Standard Deviation}
 \usage{
-  bootSD(R, ..., replications = 1000)
+bootSD(R, ..., replications = 1000)
 }
 \arguments{
   \item{R}{xts object or matrix of asset returns}
@@ -13,8 +13,8 @@
   \item{replications}{number of bootstrap replications.}
 }
 \description{
-  Bootstrap the standard deviation of an xts object or
-  matrix of asset returns
+Bootstrap the standard deviation of an xts object or matrix
+of asset returns
 }
 \examples{
 data(crsp_weekly)
@@ -23,9 +23,9 @@
 bootSD(R)
 }
 \author{
-  Ross Bennett
+Ross Bennett
 }
 \seealso{
-  \code{\link[stats]{sd}}
+\code{\link[stats]{sd}}
 }
 

Modified: pkg/GARPFRM/man/bootSimpleVolatility.Rd
===================================================================
--- pkg/GARPFRM/man/bootSimpleVolatility.Rd	2014-04-26 23:56:28 UTC (rev 172)
+++ pkg/GARPFRM/man/bootSimpleVolatility.Rd	2014-06-09 20:00:03 UTC (rev 173)
@@ -2,7 +2,7 @@
 \alias{bootSimpleVolatility}
 \title{Bootstrap Simple Volatility}
 \usage{
-  bootSimpleVolatility(R, ..., replications = 1000)
+bootSimpleVolatility(R, ..., replications = 1000)
 }
 \arguments{
   \item{R}{xts object or matrix of asset returns}
@@ -13,8 +13,8 @@
   \item{replications}{number of bootstrap replications.}
 }
 \description{
-  Bootstrap the simple volatility of an xts object or
-  matrix of asset returns
+Bootstrap the simple volatility of an xts object or matrix
+of asset returns
 }
 \examples{
 data(crsp_weekly)
@@ -23,9 +23,9 @@
 bootSimpleVolatility(R)
 }
 \author{
-  Ross Bennett
+Ross Bennett
 }
 \seealso{
-  \code{\link{simpleVolatility}}
+\code{\link{simpleVolatility}}
 }
 

Modified: pkg/GARPFRM/man/bootStdDev.Rd
===================================================================
--- pkg/GARPFRM/man/bootStdDev.Rd	2014-04-26 23:56:28 UTC (rev 172)
+++ pkg/GARPFRM/man/bootStdDev.Rd	2014-06-09 20:00:03 UTC (rev 173)
@@ -2,7 +2,7 @@
 \alias{bootStdDev}
 \title{Bootstrap StdDev}
 \usage{
-  bootStdDev(R, ..., replications = 1000)
+bootStdDev(R, ..., replications = 1000)
 }
 \arguments{
   \item{R}{xts object or matrix of asset returns}
@@ -13,8 +13,8 @@
   \item{replications}{number of bootstrap replications.}
 }
 \description{
-  Bootstrap the StdDev of an xts object or matrix of asset
-  returns
+Bootstrap the StdDev of an xts object or matrix of asset
+returns
 }
 \examples{
 data(crsp_weekly)
@@ -23,9 +23,9 @@
 bootStdDev(R)
 }
 \author{
-  Ross Bennett
+Ross Bennett
 }
 \seealso{
-  \code{\link[PerformanceAnalytics]{StdDev}}
+\code{\link[PerformanceAnalytics]{StdDev}}
 }
 

Modified: pkg/GARPFRM/man/bootVaR.Rd
===================================================================
--- pkg/GARPFRM/man/bootVaR.Rd	2014-04-26 23:56:28 UTC (rev 172)
+++ pkg/GARPFRM/man/bootVaR.Rd	2014-06-09 20:00:03 UTC (rev 173)
@@ -2,7 +2,7 @@
 \alias{bootVaR}
 \title{Bootstrap Value at Risk}
 \usage{
-  bootVaR(R, ..., replications = 1000)
+bootVaR(R, ..., replications = 1000)
 }
 \arguments{
   \item{R}{xts object or matrix of asset returns}
@@ -13,8 +13,8 @@
   \item{replications}{number of bootstrap replications.}
 }
 \description{
-  Bootstrap the Value at Risk (VaR) of an xts object or
-  matrix of asset returns
+Bootstrap the Value at Risk (VaR) of an xts object or
+matrix of asset returns
 }
 \examples{
 data(crsp_weekly)
@@ -24,9 +24,9 @@
 bootVaR(R, p=0.9, method="historical", invert=FALSE)
 }
 \author{
-  Ross Bennett
+Ross Bennett
 }
 \seealso{
-  \code{\link[PerformanceAnalytics]{VaR}}
+\code{\link[PerformanceAnalytics]{VaR}}
 }
 

Modified: pkg/GARPFRM/man/chartSML.Rd
===================================================================
--- pkg/GARPFRM/man/chartSML.Rd	2014-04-26 23:56:28 UTC (rev 172)
+++ pkg/GARPFRM/man/chartSML.Rd	2014-06-09 20:00:03 UTC (rev 173)
@@ -2,7 +2,7 @@
 \alias{chartSML}
 \title{CAPM SML}
 \usage{
-  chartSML(object, ..., main = "Estimated SML")
+chartSML(object, ..., main = "Estimated SML")
 }
 \arguments{
   \item{object}{a capm object created by
@@ -14,12 +14,12 @@
   \item{main}{a main title for the plot.}
 }
 \description{
-  Security Market Line (SML) of the CAPM. The SML is a
-  represesentation of the CAPM. It illustrates the expected
-  rate of return of an individual security as a function of
-  systematic, non-diversified risk (known as beta).
+Security Market Line (SML) of the CAPM. The SML is a
+represesentation of the CAPM. It illustrates the expected
+rate of return of an individual security as a function of
+systematic, non-diversified risk (known as beta).
 }
 \author{
-  Thomas Fillebeen
+Thomas Fillebeen
 }
 

Modified: pkg/GARPFRM/man/efficientFrontier.Rd
===================================================================
--- pkg/GARPFRM/man/efficientFrontier.Rd	2014-04-26 23:56:28 UTC (rev 172)
+++ pkg/GARPFRM/man/efficientFrontier.Rd	2014-06-09 20:00:03 UTC (rev 173)
@@ -2,9 +2,8 @@
 \alias{efficientFrontier}
 \title{Efficient Frontier}
 \usage{
-  efficientFrontier(R, nPortfolios = 25, minBox = 0,
-    maxBox = 1, groupList = NULL, groupMin = NULL,
-    groupMax = NULL)
+efficientFrontier(R, nPortfolios = 25, minBox = 0, maxBox = 1,
+  groupList = NULL, groupMin = NULL, groupMax = NULL)
 }
 \arguments{
   \item{R}{xts object of asset returns}
@@ -23,14 +22,14 @@
   \item{groupMax}{group constraint maximum}
 }
 \description{
-  Generate portfolios along an efficient frontier.
+Generate portfolios along an efficient frontier.
 }
 \details{
-  This is a wrapper function for code in PortfolioAnalytics
-  to initialize a portfolio and create an efficint frontier
-  in mean - standard deviation space. Box constraints and
-  group constraints are supported for constrained
-  optimization to generate portfolios along the efficient
-  frontier.
+This is a wrapper function for code in PortfolioAnalytics
+to initialize a portfolio and create an efficint frontier
+in mean - standard deviation space. Box constraints and
+group constraints are supported for constrained
+optimization to generate portfolios along the efficient
+frontier.
 }
 

Modified: pkg/GARPFRM/man/efficientFrontierTwoAsset.Rd
===================================================================
--- pkg/GARPFRM/man/efficientFrontierTwoAsset.Rd	2014-04-26 23:56:28 UTC (rev 172)
+++ pkg/GARPFRM/man/efficientFrontierTwoAsset.Rd	2014-06-09 20:00:03 UTC (rev 173)
@@ -2,9 +2,8 @@
 \alias{efficientFrontierTwoAsset}
 \title{Efficient Frontier for Portfolio of Two Assets}
 \usage{
-  efficientFrontierTwoAsset(R1, R2, sigma1, sigma2, rho,
-    nPortfolios = 25, rf = 0, allowShorting = FALSE,
-    weights = NULL)
+efficientFrontierTwoAsset(R1, R2, sigma1, sigma2, rho, nPortfolios = 25,
+  rf = 0, allowShorting = FALSE, weights = NULL)
 }
 \arguments{
   \item{R1}{expected return for asset 1}
@@ -32,13 +31,13 @@
   ignored.}
 }
 \description{
-  Create an efficient frontier for a portfolio of two risky
-  assets
+Create an efficient frontier for a portfolio of two risky
+assets
 }
 \details{
-  This is a specialized function to generate points along
-  the efficient frontier for a portfolio of two assets
-  following the equations presented in Chapter 3:
-  Delineating Efficient Portfolios.
+This is a specialized function to generate points along the
+efficient frontier for a portfolio of two assets following
+the equations presented in Chapter 3: Delineating Efficient
+Portfolios.
 }
 

Modified: pkg/GARPFRM/man/endingPrices.Rd
===================================================================
--- pkg/GARPFRM/man/endingPrices.Rd	2014-04-26 23:56:28 UTC (rev 172)
+++ pkg/GARPFRM/man/endingPrices.Rd	2014-06-09 20:00:03 UTC (rev 173)
@@ -2,18 +2,18 @@
 \alias{endingPrices}
 \title{Ending Prices of Monte Carlo Simulation}
 \usage{
-  endingPrices(mc)
+endingPrices(mc)
 }
 \arguments{
   \item{mc}{monte carlo object created with
   \code{monteCarlo}}
 }
 \value{
-  vector ending prices
+vector ending prices
 }
 \description{
-  Get the ending prices, i.e. terminal values, of a monte
-  carlo simulation
+Get the ending prices, i.e. terminal values, of a monte
+carlo simulation
 }
 \examples{
 library(GARPFRM)

Modified: pkg/GARPFRM/man/estimateLambdaCor.Rd
===================================================================
--- pkg/GARPFRM/man/estimateLambdaCor.Rd	2014-04-26 23:56:28 UTC (rev 172)
+++ pkg/GARPFRM/man/estimateLambdaCor.Rd	2014-06-09 20:00:03 UTC (rev 173)
@@ -2,7 +2,7 @@
 \alias{estimateLambdaCor}
 \title{Estimated Lambda}
 \usage{
-  estimateLambdaCor(R, initialWindow = 10, n = 10)
+estimateLambdaCor(R, initialWindow = 10, n = 10)
 }
 \arguments{
   \item{R}{xts object of asset returns}
@@ -14,12 +14,12 @@
   correlation}
 }
 \description{
-  Estimate lambda for EWMA correlation estimate
+Estimate lambda for EWMA correlation estimate
 }
 \details{
-  The optimal value for lambda is calcualted by minimizing
-  the mean squared error between the estimated correlation
-  and realized correlation.
+The optimal value for lambda is calcualted by minimizing
+the mean squared error between the estimated correlation
+and realized correlation.
 }
 \examples{
 data(crsp_weekly)
@@ -28,6 +28,6 @@
 lambda <- estimateLambdaCor(R, initialWindow, n=10)
 }
 \author{
-  Ross Bennett
+Ross Bennett
 }
 

Modified: pkg/GARPFRM/man/estimateLambdaCov.Rd
===================================================================
--- pkg/GARPFRM/man/estimateLambdaCov.Rd	2014-04-26 23:56:28 UTC (rev 172)
+++ pkg/GARPFRM/man/estimateLambdaCov.Rd	2014-06-09 20:00:03 UTC (rev 173)
@@ -2,7 +2,7 @@
 \alias{estimateLambdaCov}
 \title{Estimated Lambda}
 \usage{
-  estimateLambdaCov(R, initialWindow = 10, n = 10)
+estimateLambdaCov(R, initialWindow = 10, n = 10)
 }
 \arguments{
   \item{R}{xts object of asset returns}
@@ -14,12 +14,12 @@
   covariance}
 }
 \description{
-  Estimate lambda for EWMA covariance estimate
+Estimate lambda for EWMA covariance estimate
 }
 \details{
-  The optimal value for lambda is calcualted by minimizing
-  the mean squared error between the estimated covariance
-  and realized covariance.
+The optimal value for lambda is calcualted by minimizing
+the mean squared error between the estimated covariance and
+realized covariance.
 }
 \examples{
 data(crsp_weekly)
@@ -28,6 +28,6 @@
 lambda <- estimateLambdaCov(R, initialWindow, n=10)
 }
 \author{
-  Ross Bennett
+Ross Bennett
 }
 

Modified: pkg/GARPFRM/man/estimateLambdaVol.Rd
===================================================================
--- pkg/GARPFRM/man/estimateLambdaVol.Rd	2014-04-26 23:56:28 UTC (rev 172)
+++ pkg/GARPFRM/man/estimateLambdaVol.Rd	2014-06-09 20:00:03 UTC (rev 173)
@@ -2,7 +2,7 @@
 \alias{estimateLambdaVol}
 \title{Estimated Lambda}
 \usage{
-  estimateLambdaVol(R, initialWindow = 10, n = 10)
+estimateLambdaVol(R, initialWindow = 10, n = 10)
 }
 \arguments{
   \item{R}{xts object of asset returns}
@@ -14,12 +14,12 @@
   volatility}
 }
 \description{
-  Estimate lambda for EWMA volatility estimate
+Estimate lambda for EWMA volatility estimate
 }
 \details{
-  The optimal value for lambda is calcualted by minimizing
-  the mean squared error between the estimated volatility
-  and realized volatility.
+The optimal value for lambda is calcualted by minimizing
+the mean squared error between the estimated volatility and
+realized volatility.
 }
 \examples{
 data(crsp_weekly)
@@ -28,6 +28,6 @@
 lambda <- estimateLambdaVol(R, initialWindow, n=10)
 }
 \author{
-  Ross Bennett
+Ross Bennett
 }
 

Modified: pkg/GARPFRM/man/forecast.Rd
===================================================================
--- pkg/GARPFRM/man/forecast.Rd	2014-04-26 23:56:28 UTC (rev 172)
+++ pkg/GARPFRM/man/forecast.Rd	2014-06-09 20:00:03 UTC (rev 173)
@@ -2,7 +2,7 @@
 \alias{forecast}
 \title{Model Forecasting}
 \usage{
-  forecast(model, nAhead, ...)
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/uwgarp -r 173


More information about the Uwgarp-commits mailing list