[Returnanalytics-commits] r3612 - in pkg/FactorAnalytics: R man vignettes
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sun Mar 15 18:06:23 CET 2015
Author: pragnya
Date: 2015-03-15 18:06:23 +0100 (Sun, 15 Mar 2015)
New Revision: 3612
Modified:
pkg/FactorAnalytics/R/fitTsfm.R
pkg/FactorAnalytics/man/print.pafm.Rd
pkg/FactorAnalytics/man/print.sfm.Rd
pkg/FactorAnalytics/man/print.tsfm.Rd
pkg/FactorAnalytics/man/print.tsfmUpDn.Rd
pkg/FactorAnalytics/man/summary.pafm.Rd
pkg/FactorAnalytics/man/summary.sfm.Rd
pkg/FactorAnalytics/man/summary.tsfm.Rd
pkg/FactorAnalytics/man/summary.tsfmUpDn.Rd
pkg/FactorAnalytics/vignettes/fitSfm_vignette.Rnw
pkg/FactorAnalytics/vignettes/fitTsfm_vignette.Rnw
Log:
Removed warning about excess returns in fitTsfm
Modified: pkg/FactorAnalytics/R/fitTsfm.R
===================================================================
--- pkg/FactorAnalytics/R/fitTsfm.R 2015-03-15 16:39:29 UTC (rev 3611)
+++ pkg/FactorAnalytics/R/fitTsfm.R 2015-03-15 17:06:23 UTC (rev 3612)
@@ -189,10 +189,10 @@
factor.names <- NULL
}
- if (xor(is.null(mkt.name), is.null(mkt.timing))) {
- stop("Missing argument: Both mkt.name and mkt.timing are necessary to add
- market timing factors")
- }
+# if (xor(is.null(mkt.name), is.null(mkt.timing))) {
+# stop("Missing argument: Both mkt.name and mkt.timing are necessary to add
+# market timing factors")
+# }
# extract arguments to pass to different fit and variable selection functions
decay <- control$decay
Modified: pkg/FactorAnalytics/man/print.pafm.Rd
===================================================================
--- pkg/FactorAnalytics/man/print.pafm.Rd 2015-03-15 16:39:29 UTC (rev 3611)
+++ pkg/FactorAnalytics/man/print.pafm.Rd 2015-03-15 17:06:23 UTC (rev 3612)
@@ -1,30 +1,29 @@
-% Generated by roxygen2 (4.1.0): do not edit by hand
-% Please edit documentation in R/print.pafm.r
-\name{print.pafm}
-\alias{print.pafm}
-\title{Print object of class \code{"pafm"}.}
-\usage{
-\method{print}{pafm}(x, ...)
-}
-\arguments{
-\item{x}{object of class \code{"pafm"} created by
-\code{paFm}.}
-
-\item{...}{Other arguments for \code{print} methods.}
-}
-\description{
-Generic function of print method for \code{paFm}.
-}
-\examples{
-# load data from the database
- data(managers)
-# fit the factor model with OLS
-fit <- fitTsfm(asset.names=colnames(managers[,(1:6)]),
- factor.names=c("EDHEC.LS.EQ","SP500.TR"), data=managers)
-fm.attr <- paFm(fit)
-print(fm.attr)
-}
-\author{
-Yi-An Chen.
-}
-
+% Generated by roxygen2 (4.0.2): do not edit by hand
+\name{print.pafm}
+\alias{print.pafm}
+\title{Print object of class \code{"pafm"}.}
+\usage{
+\method{print}{pafm}(x, ...)
+}
+\arguments{
+\item{x}{object of class \code{"pafm"} created by
+\code{paFm}.}
+
+\item{...}{Other arguments for \code{print} methods.}
+}
+\description{
+Generic function of print method for \code{paFm}.
+}
+\examples{
+# load data from the database
+ data(managers)
+# fit the factor model with OLS
+fit <- fitTsfm(asset.names=colnames(managers[,(1:6)]),
+ factor.names=c("EDHEC.LS.EQ","SP500.TR"), data=managers)
+fm.attr <- paFm(fit)
+print(fm.attr)
+}
+\author{
+Yi-An Chen.
+}
+
Modified: pkg/FactorAnalytics/man/print.sfm.Rd
===================================================================
--- pkg/FactorAnalytics/man/print.sfm.Rd 2015-03-15 16:39:29 UTC (rev 3611)
+++ pkg/FactorAnalytics/man/print.sfm.Rd 2015-03-15 17:06:23 UTC (rev 3612)
@@ -1,33 +1,32 @@
-% Generated by roxygen2 (4.1.0): do not edit by hand
-% Please edit documentation in R/print.sfm.r
-\name{print.sfm}
-\alias{print.sfm}
-\title{Prints out a fitted statictical factor model object}
-\usage{
-\method{print}{sfm}(x, digits = max(3, .Options$digits - 3), ...)
-}
-\arguments{
-\item{x}{an object of class \code{sfm} produced by \code{fitSfm}.}
-
-\item{digits}{an integer value, to indicate the required number of
-significant digits. Default is 3.}
-
-\item{...}{optional arguments passed to the \code{print} method.}
-}
-\description{
-S3 \code{print} method for object of class \code{sfm}. Prints
-the call, factor model dimension, factor loadings, r-squared and residual
-volatilities from the fitted object.
-}
-\examples{
-data(StockReturns)
-fit <- fitSfm(r.M, k=2)
-print(fit)
-}
-\author{
-Yi-An Chen and Sangeetha Srinivasan
-}
-\seealso{
-\code{\link{fitSfm}}, \code{\link{summary.sfm}}
-}
-
+% Generated by roxygen2 (4.0.2): do not edit by hand
+\name{print.sfm}
+\alias{print.sfm}
+\title{Prints out a fitted statictical factor model object}
+\usage{
+\method{print}{sfm}(x, digits = max(3, .Options$digits - 3), ...)
+}
+\arguments{
+\item{x}{an object of class \code{sfm} produced by \code{fitSfm}.}
+
+\item{digits}{an integer value, to indicate the required number of
+significant digits. Default is 3.}
+
+\item{...}{optional arguments passed to the \code{print} method.}
+}
+\description{
+S3 \code{print} method for object of class \code{sfm}. Prints
+the call, factor model dimension, factor loadings, r-squared and residual
+volatilities from the fitted object.
+}
+\examples{
+data(StockReturns)
+fit <- fitSfm(r.M, k=2)
+print(fit)
+}
+\author{
+Yi-An Chen and Sangeetha Srinivasan
+}
+\seealso{
+\code{\link{fitSfm}}, \code{\link{summary.sfm}}
+}
+
Modified: pkg/FactorAnalytics/man/print.tsfm.Rd
===================================================================
--- pkg/FactorAnalytics/man/print.tsfm.Rd 2015-03-15 16:39:29 UTC (rev 3611)
+++ pkg/FactorAnalytics/man/print.tsfm.Rd 2015-03-15 17:06:23 UTC (rev 3612)
@@ -1,35 +1,34 @@
-% Generated by roxygen2 (4.1.0): do not edit by hand
-% Please edit documentation in R/print.tsfm.r
-\name{print.tsfm}
-\alias{print.tsfm}
-\title{Prints out a fitted time series factor model object}
-\usage{
-\method{print}{tsfm}(x, digits = max(3, .Options$digits - 3), ...)
-}
-\arguments{
-\item{x}{an object of class \code{tsfm} produced by \code{fitTsfm}.}
-
-\item{digits}{an integer value, to indicate the required number of
-significant digits. Default is 3.}
-
-\item{...}{optional arguments passed to the \code{print} method.}
-}
-\description{
-S3 \code{print} method for object of class \code{tsfm}. Prints
-the call, factor model dimension, regression coefficients, r-squared and
-residual volatilities from the fitted object.
-}
-\examples{
-data(managers)
-fit <- fitTsfm(asset.names=colnames(managers[,(1:6)]),
- factor.names=colnames(managers[,7:9]),
- mkt.name="SP500.TR", mkt.timing="both", data=managers)
-print(fit)
-}
-\author{
-Yi-An Chen and Sangeetha Srinivasan
-}
-\seealso{
-\code{\link{fitTsfm}}, \code{\link{summary.tsfm}}
-}
-
+% Generated by roxygen2 (4.0.2): do not edit by hand
+\name{print.tsfm}
+\alias{print.tsfm}
+\title{Prints out a fitted time series factor model object}
+\usage{
+\method{print}{tsfm}(x, digits = max(3, .Options$digits - 3), ...)
+}
+\arguments{
+\item{x}{an object of class \code{tsfm} produced by \code{fitTsfm}.}
+
+\item{digits}{an integer value, to indicate the required number of
+significant digits. Default is 3.}
+
+\item{...}{optional arguments passed to the \code{print} method.}
+}
+\description{
+S3 \code{print} method for object of class \code{tsfm}. Prints
+the call, factor model dimension, regression coefficients, r-squared and
+residual volatilities from the fitted object.
+}
+\examples{
+data(managers)
+fit <- fitTsfm(asset.names=colnames(managers[,(1:6)]),
+ factor.names=colnames(managers[,7:9]),
+ mkt.name="SP500.TR", mkt.timing="both", data=managers)
+print(fit)
+}
+\author{
+Yi-An Chen and Sangeetha Srinivasan
+}
+\seealso{
+\code{\link{fitTsfm}}, \code{\link{summary.tsfm}}
+}
+
Modified: pkg/FactorAnalytics/man/print.tsfmUpDn.Rd
===================================================================
--- pkg/FactorAnalytics/man/print.tsfmUpDn.Rd 2015-03-15 16:39:29 UTC (rev 3611)
+++ pkg/FactorAnalytics/man/print.tsfmUpDn.Rd 2015-03-15 17:06:23 UTC (rev 3612)
@@ -1,36 +1,35 @@
-% Generated by roxygen2 (4.1.0): do not edit by hand
-% Please edit documentation in R/print.tsfmUpDn.r
-\name{print.tsfmUpDn}
-\alias{print.tsfmUpDn}
-\title{Prints out a fitted up and down market time series factor model object}
-\usage{
-\method{print}{tsfmUpDn}(x, digits = max(3, .Options$digits - 3), ...)
-}
-\arguments{
-\item{x}{an object of class \code{tsfmUpDn} produced by \code{fitTsfmUpDn}.}
-
-\item{digits}{an integer value, to indicate the required number of
-significant digits. Default is 3.}
-
-\item{...}{optional arguments passed to the \code{print} method.}
-}
-\description{
-S3 \code{print} method for object of class \code{tsfmUpDn}. Prints
-the call, factor model dimension, regression coefficients, r-squared and
-residual volatilities from the fitted object.
-}
-\examples{
-data(managers)
-# example: Up and down market factor model with OLS fit
-fitUpDn <- fitTsfmUpDn(asset.names=colnames(managers[,(1:6)]),mkt.name="SP500.TR",
- data=managers, fit.method="OLS",control=NULL)
-
-print(fitUpDn)
-}
-\author{
-Yi-An Chen and Sangeetha Srinivasan
-}
-\seealso{
-\code{\link{fitTsfmUpDn}}, \code{\link{summary.tsfmUpDn}}
-}
-
+% Generated by roxygen2 (4.0.2): do not edit by hand
+\name{print.tsfmUpDn}
+\alias{print.tsfmUpDn}
+\title{Prints out a fitted up and down market time series factor model object}
+\usage{
+\method{print}{tsfmUpDn}(x, digits = max(3, .Options$digits - 3), ...)
+}
+\arguments{
+\item{x}{an object of class \code{tsfmUpDn} produced by \code{fitTsfmUpDn}.}
+
+\item{digits}{an integer value, to indicate the required number of
+significant digits. Default is 3.}
+
+\item{...}{optional arguments passed to the \code{print} method.}
+}
+\description{
+S3 \code{print} method for object of class \code{tsfmUpDn}. Prints
+the call, factor model dimension, regression coefficients, r-squared and
+residual volatilities from the fitted object.
+}
+\examples{
+data(managers)
+# example: Up and down market factor model with OLS fit
+fitUpDn <- fitTsfmUpDn(asset.names=colnames(managers[,(1:6)]),mkt.name="SP500.TR",
+ data=managers, fit.method="OLS",control=NULL)
+
+print(fitUpDn)
+}
+\author{
+Yi-An Chen and Sangeetha Srinivasan
+}
+\seealso{
+\code{\link{fitTsfmUpDn}}, \code{\link{summary.tsfmUpDn}}
+}
+
Modified: pkg/FactorAnalytics/man/summary.pafm.Rd
===================================================================
--- pkg/FactorAnalytics/man/summary.pafm.Rd 2015-03-15 16:39:29 UTC (rev 3611)
+++ pkg/FactorAnalytics/man/summary.pafm.Rd 2015-03-15 17:06:23 UTC (rev 3612)
@@ -1,34 +1,33 @@
-% Generated by roxygen2 (4.1.0): do not edit by hand
-% Please edit documentation in R/summary.pafm.r
-\name{summary.pafm}
-\alias{summary.pafm}
-\title{summary \code{"pafm"} object.}
-\usage{
-\method{summary}{pafm}(object, digits = max(3, .Options$digits - 3), ...)
-}
-\arguments{
-\item{object}{\code{"pafm"} object created by
-\code{paFm}.}
-
-\item{digits}{integer indicating the number of decimal places. Default is 3.}
-
-\item{...}{Other arguments for \code{print} methods.}
-}
-\description{
-Generic function of summary method for \code{paFm}.
-}
-\examples{
-# load data from the database
-data(managers)
-# fit the factor model with OLS
-fit.ts <- fitTsfm(asset.names=colnames(managers[,(1:6)]),
- factor.names=c("EDHEC.LS.EQ","SP500.TR"),
- data=managers)
-
-fm.attr <- paFm(fit.ts)
-summary(fm.attr)
-}
-\author{
-Yi-An Chen.
-}
-
+% Generated by roxygen2 (4.0.2): do not edit by hand
+\name{summary.pafm}
+\alias{summary.pafm}
+\title{summary \code{"pafm"} object.}
+\usage{
+\method{summary}{pafm}(object, digits = max(3, .Options$digits - 3), ...)
+}
+\arguments{
+\item{object}{\code{"pafm"} object created by
+\code{paFm}.}
+
+\item{digits}{integer indicating the number of decimal places. Default is 3.}
+
+\item{...}{Other arguments for \code{print} methods.}
+}
+\description{
+Generic function of summary method for \code{paFm}.
+}
+\examples{
+# load data from the database
+data(managers)
+# fit the factor model with OLS
+fit.ts <- fitTsfm(asset.names=colnames(managers[,(1:6)]),
+ factor.names=c("EDHEC.LS.EQ","SP500.TR"),
+ data=managers)
+
+fm.attr <- paFm(fit.ts)
+summary(fm.attr)
+}
+\author{
+Yi-An Chen.
+}
+
Modified: pkg/FactorAnalytics/man/summary.sfm.Rd
===================================================================
--- pkg/FactorAnalytics/man/summary.sfm.Rd 2015-03-15 16:39:29 UTC (rev 3611)
+++ pkg/FactorAnalytics/man/summary.sfm.Rd 2015-03-15 17:06:23 UTC (rev 3612)
@@ -1,70 +1,69 @@
-% Generated by roxygen2 (4.1.0): do not edit by hand
-% Please edit documentation in R/summary.sfm.r
-\name{summary.sfm}
-\alias{print.summary.sfm}
-\alias{summary.sfm}
-\title{Summarizing a fitted time series factor model}
-\usage{
-\method{summary}{sfm}(object, se.type = c("Default", "HC", "HAC"),
- n.top = 3, ...)
-
-\method{print}{summary.sfm}(x, digits = 3, ...)
-}
-\arguments{
-\item{object}{an object of class \code{sfm} returned by \code{fitSfm}.}
-
-\item{se.type}{one of "Default", "HC" or "HAC"; option for computing HC/HAC
-standard errors and t-statistics. Default is "Default".}
-
-\item{n.top}{scalar; number of largest and smallest weights to display for
-each factor mimicking portfolio. Default is 3.}
-
-\item{...}{futher arguments passed to or from other methods.}
-
-\item{x}{an object of class \code{summary.sfm}.}
-
-\item{digits}{number of significants digits to use when printing.
-Default is 3.}
-}
-\value{
-Returns an object of class \code{summary.sfm}.
-The print method for class \code{summary.sfm} outputs the call,
-coefficients (with standard errors and t-statistics), r-squared and
-residual volatilty (under the homoskedasticity assumption) for all assets as
-well as a summary of the factor mimicking portfolio weights.
-
-Object of class \code{summary.sfm} is a list of length N+2 containing:
-\item{call}{the function call to \code{fitSfm}}
-\item{se.type}{standard error type as input}
-\item{sum.list}{list of summaries for the N fit objects of class \code{lm}
-for each asset in the factor model.}
-\item{mimic.sum}{list of data.frame objects containing \code{n.top} largest
-and smallest weights for each factor mimicking portfolio.}
-}
-\description{
-\code{summary} method for object of class \code{sfm}.
-Returned object is of class {summary.sfm}.
-}
-\details{
-The default \code{summary} method for a fitted \code{lm} object
-computes the standard errors and t-statistics under the assumption of
-homoskedasticty. Argument \code{se.type} gives the option to compute
-heteroskedasticity-consistent (HC) or
-heteroskedasticity-autocorrelation-consistent (HAC) standard errors and
-t-statistics using \code{\link[lmtest]{coeftest}}.
-}
-\examples{
-data(StockReturns)
-# fit the factor model with PCA
-fit <- fitSfm(r.M, k=2)
-
-# summary of factor model fit for all assets
-summary(fit, "HAC")
-}
-\author{
-Sangeetha Srinivasan
-}
-\seealso{
-\code{\link{fitSfm}}, \code{\link[stats]{summary.lm}}
-}
-
+% Generated by roxygen2 (4.0.2): do not edit by hand
+\name{summary.sfm}
+\alias{print.summary.sfm}
+\alias{summary.sfm}
+\title{Summarizing a fitted time series factor model}
+\usage{
+\method{summary}{sfm}(object, se.type = c("Default", "HC", "HAC"),
+ n.top = 3, ...)
+
+\method{print}{summary.sfm}(x, digits = 3, ...)
+}
+\arguments{
+\item{object}{an object of class \code{sfm} returned by \code{fitSfm}.}
+
+\item{se.type}{one of "Default", "HC" or "HAC"; option for computing HC/HAC
+standard errors and t-statistics. Default is "Default".}
+
+\item{n.top}{scalar; number of largest and smallest weights to display for
+each factor mimicking portfolio. Default is 3.}
+
+\item{...}{futher arguments passed to or from other methods.}
+
+\item{x}{an object of class \code{summary.sfm}.}
+
+\item{digits}{number of significants digits to use when printing.
+Default is 3.}
+}
+\value{
+Returns an object of class \code{summary.sfm}.
+The print method for class \code{summary.sfm} outputs the call,
+coefficients (with standard errors and t-statistics), r-squared and
+residual volatilty (under the homoskedasticity assumption) for all assets as
+well as a summary of the factor mimicking portfolio weights.
+
+Object of class \code{summary.sfm} is a list of length N+2 containing:
+\item{call}{the function call to \code{fitSfm}}
+\item{se.type}{standard error type as input}
+\item{sum.list}{list of summaries for the N fit objects of class \code{lm}
+for each asset in the factor model.}
+\item{mimic.sum}{list of data.frame objects containing \code{n.top} largest
+and smallest weights for each factor mimicking portfolio.}
+}
+\description{
+\code{summary} method for object of class \code{sfm}.
+Returned object is of class {summary.sfm}.
+}
+\details{
+The default \code{summary} method for a fitted \code{lm} object
+computes the standard errors and t-statistics under the assumption of
+homoskedasticty. Argument \code{se.type} gives the option to compute
+heteroskedasticity-consistent (HC) or
+heteroskedasticity-autocorrelation-consistent (HAC) standard errors and
+t-statistics using \code{\link[lmtest]{coeftest}}.
+}
+\examples{
+data(StockReturns)
+# fit the factor model with PCA
+fit <- fitSfm(r.M, k=2)
+
+# summary of factor model fit for all assets
+summary(fit, "HAC")
+}
+\author{
+Sangeetha Srinivasan
+}
+\seealso{
+\code{\link{fitSfm}}, \code{\link[stats]{summary.lm}}
+}
+
Modified: pkg/FactorAnalytics/man/summary.tsfm.Rd
===================================================================
--- pkg/FactorAnalytics/man/summary.tsfm.Rd 2015-03-15 16:39:29 UTC (rev 3611)
+++ pkg/FactorAnalytics/man/summary.tsfm.Rd 2015-03-15 17:06:23 UTC (rev 3612)
@@ -1,73 +1,72 @@
-% Generated by roxygen2 (4.1.0): do not edit by hand
-% Please edit documentation in R/summary.tsfm.r
-\name{summary.tsfm}
-\alias{print.summary.tsfm}
-\alias{summary.tsfm}
-\title{Summarizing a fitted time series factor model}
-\usage{
-\method{summary}{tsfm}(object, se.type = c("Default", "HC", "HAC"), ...)
-
-\method{print}{summary.tsfm}(x, digits = 3, ...)
-}
-\arguments{
-\item{object}{an object of class \code{tsfm} returned by \code{fitTsfm}.}
-
-\item{se.type}{one of "Default", "HC" or "HAC"; option for computing
-HC/HAC standard errors and t-statistics. Default is "Default".}
-
-\item{...}{futher arguments passed to or from other methods.}
-
-\item{x}{an object of class \code{summary.tsfm}.}
-
-\item{digits}{number of significants digits to use when printing.
-Default is 3.}
-}
-\value{
-Returns an object of class \code{summary.tsfm}.
-The print method for class \code{summary.tsfm} outputs the call,
-coefficients (with standard errors and t-statistics), r-squared and
-residual volatilty (under the homoskedasticity assumption) for all assets.
-
-Object of class \code{summary.tsfm} is a list of length N + 2 containing:
-\item{call}{the function call to \code{fitTsfm}}
-\item{se.type}{standard error type as input}
-\item{sum.list}{list of summaries of the N fit objects (of class \code{lm},
-\code{lmRob} or \code{lars}) for each asset in the factor model.}
-}
-\description{
-\code{summary} method for object of class \code{tsfm}.
-Returned object is of class {summary.tsfm}.
-}
-\details{
-The default \code{summary} method for a fitted \code{lm} object
-computes the standard errors and t-statistics under the assumption of
-homoskedasticty. Argument \code{se.type} gives the option to compute
-heteroskedasticity-consistent (HC) or
-heteroskedasticity-autocorrelation-consistent (HAC) standard errors and
-t-statistics using \code{\link[lmtest]{coeftest}}. This option is meaningful
-only if \code{fit.method = "OLS" or "DLS"}.
-
-Standard errors are currently not available for
-\code{variable.selection="lars"} as there seems to be no consensus on a
-statistically valid method of calculating standard errors for the lasso
-predictions.
-}
-\examples{
-data(managers)
-fit <- fitTsfm(asset.names=colnames(managers[,(1:6)]),
- factor.names=colnames(managers[,7:9]),
- data=managers)
-
-# summary of factor model fit for all assets
-summary(fit, "HAC")
-
-# summary of lm fit for a single asset
-summary(fit$asset.fit[[1]])
-}
-\author{
-Sangeetha Srinivasan & Yi-An Chen.
-}
-\seealso{
-\code{\link{fitTsfm}}, \code{\link[stats]{summary.lm}}
-}
-
+% Generated by roxygen2 (4.0.2): do not edit by hand
+\name{summary.tsfm}
+\alias{print.summary.tsfm}
+\alias{summary.tsfm}
+\title{Summarizing a fitted time series factor model}
+\usage{
+\method{summary}{tsfm}(object, se.type = c("Default", "HC", "HAC"), ...)
+
+\method{print}{summary.tsfm}(x, digits = 3, ...)
+}
+\arguments{
+\item{object}{an object of class \code{tsfm} returned by \code{fitTsfm}.}
+
+\item{se.type}{one of "Default", "HC" or "HAC"; option for computing
+HC/HAC standard errors and t-statistics. Default is "Default".}
+
+\item{...}{futher arguments passed to or from other methods.}
+
+\item{x}{an object of class \code{summary.tsfm}.}
+
+\item{digits}{number of significants digits to use when printing.
+Default is 3.}
+}
+\value{
+Returns an object of class \code{summary.tsfm}.
+The print method for class \code{summary.tsfm} outputs the call,
+coefficients (with standard errors and t-statistics), r-squared and
+residual volatilty (under the homoskedasticity assumption) for all assets.
+
+Object of class \code{summary.tsfm} is a list of length N + 2 containing:
+\item{call}{the function call to \code{fitTsfm}}
+\item{se.type}{standard error type as input}
+\item{sum.list}{list of summaries of the N fit objects (of class \code{lm},
+\code{lmRob} or \code{lars}) for each asset in the factor model.}
+}
+\description{
+\code{summary} method for object of class \code{tsfm}.
+Returned object is of class {summary.tsfm}.
+}
+\details{
+The default \code{summary} method for a fitted \code{lm} object
+computes the standard errors and t-statistics under the assumption of
+homoskedasticty. Argument \code{se.type} gives the option to compute
+heteroskedasticity-consistent (HC) or
+heteroskedasticity-autocorrelation-consistent (HAC) standard errors and
+t-statistics using \code{\link[lmtest]{coeftest}}. This option is meaningful
+only if \code{fit.method = "OLS" or "DLS"}.
+
+Standard errors are currently not available for
+\code{variable.selection="lars"} as there seems to be no consensus on a
+statistically valid method of calculating standard errors for the lasso
+predictions.
+}
+\examples{
+data(managers)
+fit <- fitTsfm(asset.names=colnames(managers[,(1:6)]),
+ factor.names=colnames(managers[,7:9]),
+ data=managers)
+
+# summary of factor model fit for all assets
+summary(fit, "HAC")
+
+# summary of lm fit for a single asset
+summary(fit$asset.fit[[1]])
+}
+\author{
+Sangeetha Srinivasan & Yi-An Chen.
+}
+\seealso{
+\code{\link{fitTsfm}}, \code{\link[stats]{summary.lm}}
+}
+
Modified: pkg/FactorAnalytics/man/summary.tsfmUpDn.Rd
===================================================================
--- pkg/FactorAnalytics/man/summary.tsfmUpDn.Rd 2015-03-15 16:39:29 UTC (rev 3611)
+++ pkg/FactorAnalytics/man/summary.tsfmUpDn.Rd 2015-03-15 17:06:23 UTC (rev 3612)
@@ -1,61 +1,60 @@
-% Generated by roxygen2 (4.1.0): do not edit by hand
-% Please edit documentation in R/summary.tsfmUpDn.r
-\name{summary.tsfmUpDn}
-\alias{print.summary.tsfmUpDn}
-\alias{summary.tsfmUpDn}
-\title{Summarizing a fitted up and down market time series factor model}
-\usage{
-\method{summary}{tsfmUpDn}(object, ...)
-
-\method{print}{summary.tsfmUpDn}(uD.list, digits = 3, ...)
-}
-\arguments{
-\item{object}{an object of class \code{tsfmUpDn} returned by \code{fitTsfmUpDn}.}
-
-\item{...}{futher arguments passed to or from \code{summary.tsfm} methods.}
-
-\item{uD.list}{an object of class \code{summary.tsfmUpDn}.}
-
-\item{digits}{number of significants digits to use when printing.
-Default is 3.}
-}
-\value{
-Returns an object of class \code{summary.tsfmUpDn}. This object contains
-a list object of \code{Up} and \code{Dn} for up market and down market respectively.
-
-The print method for class \code{summary.tsfmUpDn} outputs the call,
-coefficients (with standard errors and t-statistics), r-squared and
-residual volatilty (under the homoskedasticity assumption) for all assets in up and
-down market.
-
-Object of class \code{summary.tsfmUpDn} is a list of 2 containing:
-\item{Up}{A list of the up market fitted object. It is a class of \code{summary.tsfm}}
-\item{Dn}{A list of the down market fitted object. It is a class of \code{summary.tsfm}}
-}
-\description{
-\code{summary} method for object of class \code{tsfmUpDn}.
-Returned object is of class {summary.tsfmUpDn}. This function provides a \code{summary}
-method to an object returned by a wrapper function \code{fitTsfmUpDn}.
-}
-\details{
-Since \code{fitTsfmUpDn} fits both up market and down market,
-\code{summary.tsfmUpDn} applies \code{summary.tsfm} for both markets fitted
-objects and combines the coefficients interested together.
-}
-\examples{
-# load data from the database
-data(managers)
-
-# example: Up and down market factor model with OLS fit
-fitUpDn <- fitTsfmUpDn(asset.names=colnames(managers[,(1:6)]),mkt.name="SP500.TR",
- data=managers, fit.method="OLS",control=NULL)
-
- summary(fitUpDn)
-}
-\author{
-Yi-An Chen and Sangeetha Srinivasan.
-}
-\seealso{
-\code{\link{fitTsfmUpDn}}, \code{\link[stats]{summary.tsfm}}
-}
-
+% Generated by roxygen2 (4.0.2): do not edit by hand
+\name{summary.tsfmUpDn}
+\alias{print.summary.tsfmUpDn}
+\alias{summary.tsfmUpDn}
+\title{Summarizing a fitted up and down market time series factor model}
+\usage{
+\method{summary}{tsfmUpDn}(object, ...)
+
+\method{print}{summary.tsfmUpDn}(uD.list, digits = 3, ...)
+}
+\arguments{
+\item{object}{an object of class \code{tsfmUpDn} returned by \code{fitTsfmUpDn}.}
+
+\item{...}{futher arguments passed to or from \code{summary.tsfm} methods.}
+
+\item{uD.list}{an object of class \code{summary.tsfmUpDn}.}
+
+\item{digits}{number of significants digits to use when printing.
+Default is 3.}
+}
+\value{
+Returns an object of class \code{summary.tsfmUpDn}. This object contains
+a list object of \code{Up} and \code{Dn} for up market and down market respectively.
+
+The print method for class \code{summary.tsfmUpDn} outputs the call,
+coefficients (with standard errors and t-statistics), r-squared and
+residual volatilty (under the homoskedasticity assumption) for all assets in up and
+down market.
+
+Object of class \code{summary.tsfmUpDn} is a list of 2 containing:
+\item{Up}{A list of the up market fitted object. It is a class of \code{summary.tsfm}}
+\item{Dn}{A list of the down market fitted object. It is a class of \code{summary.tsfm}}
+}
+\description{
+\code{summary} method for object of class \code{tsfmUpDn}.
+Returned object is of class {summary.tsfmUpDn}. This function provides a \code{summary}
+method to an object returned by a wrapper function \code{fitTsfmUpDn}.
+}
+\details{
+Since \code{fitTsfmUpDn} fits both up market and down market,
+\code{summary.tsfmUpDn} applies \code{summary.tsfm} for both markets fitted
+objects and combines the coefficients interested together.
+}
+\examples{
+# load data from the database
+data(managers)
+
+# example: Up and down market factor model with OLS fit
+fitUpDn <- fitTsfmUpDn(asset.names=colnames(managers[,(1:6)]),mkt.name="SP500.TR",
+ data=managers, fit.method="OLS",control=NULL)
+
+ summary(fitUpDn)
+}
+\author{
+Yi-An Chen and Sangeetha Srinivasan.
+}
+\seealso{
+\code{\link{fitTsfmUpDn}}, \code{\link[stats]{summary.tsfm}}
+}
+
Modified: pkg/FactorAnalytics/vignettes/fitSfm_vignette.Rnw
===================================================================
--- pkg/FactorAnalytics/vignettes/fitSfm_vignette.Rnw 2015-03-15 16:39:29 UTC (rev 3611)
+++ pkg/FactorAnalytics/vignettes/fitSfm_vignette.Rnw 2015-03-15 17:06:23 UTC (rev 3612)
@@ -114,9 +114,9 @@
\newpage
\section{Fit a statistical factor model}
-In statistical factor models, factor realizations are not directly observable (unlike times series factor models) and the factor loadings are not known (unlike fundamental factor models). Both factors and betas must be extracted from the returns data using statistical methods such as factor analysis and Principal Component Analysis (PCA). PCA uses the eigen decomposition of the covariance (or correlation) matrix of asset returns to find the first \code{K} principal components that explain the largest portion of the sample covariance matrix of returns. Factor loadings are then estimated using time series regression. Factor analysis involves maximum likelihood optimization to estimate the factor loadings and the residual covariance matrix, constructing the factor realizations and choosing a rotation of the coordinate system for a more meaningful interpretation of the factors.
+In statistical factor models, factor realizations are not directly observable (unlike times series factor models) and the factor loadings are not known (unlike some fundamental factor models). Both factors and betas must be extracted from the returns data using statistical methods such as factor analysis or Principal Component Analysis (PCA). PCA uses the eigen decomposition of the covariance (or correlation) matrix of asset returns to find the first \code{K} principal components that explain the largest portion of the sample covariance matrix of returns. Factor loadings are then estimated using time series regression. Factor analysis involves maximum likelihood optimization to estimate the factor loadings and the residual covariance matrix, constructing the factor realizations and choosing a rotation of the coordinate system for a more meaningful interpretation of the factors.
-In \code{fitSfm}, PCA is applied to extract the factor realizations when the number of time series observations, $T$, is greater than the number of assets, $N$. When $N > T$, the sample covariance matrix for asset returns is singular and Aymptotic principal Component Analysis (APCA) as in \citet{connor1988risk} is performed.
+In \code{fitSfm}, PCA is applied to extract the factor realizations when the number of time series observations, $T$, is greater than the number of assets, $N$. When $N > T$, the sample covariance matrix for asset returns is singular and Aymptotic principal Component Analysis (APCA) due to \citet{connor1988risk} is performed.
Let's take a look at the arguments for \code{fitSfm}.
Modified: pkg/FactorAnalytics/vignettes/fitTsfm_vignette.Rnw
===================================================================
--- pkg/FactorAnalytics/vignettes/fitTsfm_vignette.Rnw 2015-03-15 16:39:29 UTC (rev 3611)
+++ pkg/FactorAnalytics/vignettes/fitTsfm_vignette.Rnw 2015-03-15 17:06:23 UTC (rev 3612)
@@ -464,7 +464,7 @@
\newpage
\subsection{Individual plots}
-Setting \code{plot.single=TRUE} enables individual asset plots. If there is more than one asset fit by the fit object, \code{asset.name} is also necessary. However, if the \code{fitSfm} object \code{x} only contains one asset's factor model fit, \code{plot.sfm} can infer this automatically, without user input.
+Setting \code{plot.single=TRUE} enables individual asset plots. If there is more than one asset fit by the fit object, \code{asset.name} is also necessary. However, if the \code{fitTsfm} object \code{x} only contains one asset's factor model fit, \code{plot.tsfm} can infer \code{asset.name} automatically, without user input.
Here's the individual plot menu.
<<eval=FALSE, results='hide'>>=
More information about the Returnanalytics-commits
mailing list